From bbffcbf739f671bdb3892e69e6c19792e0985f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Gr=C3=BCnbacher?= Date: Thu, 7 Aug 2014 21:17:45 +0200 Subject: [PATCH] cellarray: Update lying ArrayCreate doc --- plugins/include/cellarray.inc | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/plugins/include/cellarray.inc b/plugins/include/cellarray.inc index 09d4444f..1ea1b3ef 100644 --- a/plugins/include/cellarray.inc +++ b/plugins/include/cellarray.inc @@ -1,12 +1,12 @@ -// vim: set ts=4 sw=4 tw=99 noet: -// -// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). -// Copyright (C) The AMX Mod X Development Team. -// -// This software is licensed under the GNU General Public License, version 3 or higher. -// Additional exceptions apply. For full license details, see LICENSE.txt or visit: -// https://alliedmods.net/amxmodx-license - +// vim: set ts=4 sw=4 tw=99 noet: +// +// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). +// Copyright (C) The AMX Mod X Development Team. +// +// This software is licensed under the GNU General Public License, version 3 or higher. +// Additional exceptions apply. For full license details, see LICENSE.txt or visit: +// https://alliedmods.net/amxmodx-license + #if defined _cellarray_included #endinput #endif @@ -53,15 +53,19 @@ stock ByteCountToCells(size) * * @note It is very important that the provided cellsize matches up with the * buffer sizes that you pass with subsequent Array[Get|Set|Push] calls. + * @note Initially the "reserved" parameter was intended to create blank entries + * that would immediately be usable with Array[Get|Set] functions. This + * functionality was never working as intended, and can now be achieved + * using ArrayResize(). * * @param cellsize Size of each array entry in cells - * @param reserver Amount of blank entries that are inserted immediately - * upon creation of the array. These are not readable until - * initialized with an ArraySet* function. + * @param reserved Pre-allocates space in the array for the specified + * number of items. The items are not valid to read or set + * until they have actually been pushed into the array. * * @return Handle to the array. */ -native Array:ArrayCreate(cellsize = 1, reserved = 0); +native Array:ArrayCreate(cellsize = 1, reserved = 32); /** * Clones an array, returning a new handle with the same size and data.