Browse Source

Fix string case in inarray command script (#3401)

* Fixes #3400.
Thanks to @anacondaqq and @sader1992!
Sader Fawall 6 years ago
parent
commit
9cba66c22e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/map/script.cpp

+ 2 - 2
src/map/script.cpp

@@ -6398,13 +6398,13 @@ BUILDIN_FUNC(inarray)
 		for (i = 0; i <= array_size; ++i)
 		{
 			temp = (char*)get_val2(st, reference_uid(id, i), ref);
-			script_removetop(st, -1, 0);
 			if (!strcmp(temp, value))
 			{
+				script_removetop(st, -1, 0);
 				script_pushint(st, i);
 				return SCRIPT_CMD_SUCCESS;
 			}
-			
+			script_removetop(st, -1, 0);
 		}
 	}
 	else