Browse Source

* Fixed script command 'deletearray' deleting incorrect amount of array elements from arrays with empty elements (bugreport:4628).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14652 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei 14 years ago
parent
commit
7c8ea87859
3 changed files with 8 additions and 8 deletions
  1. 3 1
      Changelog-Trunk.txt
  2. 3 6
      doc/script_commands.txt
  3. 2 1
      src/map/script.c

+ 3 - 1
Changelog-Trunk.txt

@@ -1,6 +1,8 @@
 Date	Added
 
-2010/01/05
+2011/01/06
+	* Fixed script command 'deletearray' deleting incorrect amount of array elements from arrays with empty elements (bugreport:4628). [Ai4rei]
+2011/01/05
 	* Fixed ends of statement blocks missing script EOL processing, thus causing 'next line' label (-) to misbehave in statement blocks without additional curly braces (bugreport:4417, since r3422). [Ai4rei]
 2011/01/04
 	* Added support for removal of trailing comments to sv_readdb (bugreport:4680). [Ai4rei]

+ 3 - 6
doc/script_commands.txt

@@ -4,7 +4,7 @@
 //= A reference manual for the eAthena scripting language.
 //= Commands are sorted depending on their functionality.
 //===== Version ===========================================
-//= 3.34.20101217
+//= 3.35.20110106
 //=========================================================
 //= 1.0 - First release, filled will as much info as I could
 //=       remember or figure out, most likely there are errors,
@@ -153,6 +153,8 @@
 //=       behavior. [Ai4rei]
 //= 3.34.20101217
 //=       Spellcheck. [Ai4rei]
+//= 3.35.20110106
+//=       Removed bug warning from 'deletearray'. [Ai4rei]
 //=========================================================
 
 This document is a reference manual for all the scripting commands and functions 
@@ -2105,11 +2107,6 @@ array, shifting all the elements beyond this towards the beginning.
 
     deletearray @array[1],3
 
-IMPORTANT: deletarray is horribly broken since the earliest days of jAthena. It 
-tends to merrily remove much more variables than it's told to remove, which 
-makes it pretty much useless for anything other than removing an array from 
-memory entirely. This would be very handy, if it always worked. 
-
 ---------------------------------------
 
 ======================================

+ 2 - 1
src/map/script.c

@@ -5147,7 +5147,8 @@ BUILDIN_FUNC(deletearray)
 			return 0;// no player attached
 	}
 
-	end = getarraysize(st, id, start, is_string_variable(name), reference_getref(data));
+	end = SCRIPT_MAX_ARRAYSIZE;
+
 	if( start >= end )
 		return 0;// nothing to free