Переглянути джерело

* Fixed removing item scripts through script command *setitemscript not working the way it is stated in script_commands.txt (related r9831).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14999 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei 13 роки тому
батько
коміт
05673d2336
2 змінених файлів з 4 додано та 2 видалено
  1. 2 0
      Changelog-Trunk.txt
  2. 2 2
      src/map/script.c

+ 2 - 0
Changelog-Trunk.txt

@@ -1,5 +1,7 @@
 Date	Added
 
+2011/11/28
+	* Fixed removing item scripts through script command *setitemscript not working the way it is stated in script_commands.txt (related r9831). [Ai4rei]
 2011/11/19
 	* Fixed wrong damage numbers being displayed when the damage source was disguised (bugreport:5093, since r14979). [Ai4rei]
 2011/11/17

+ 2 - 2
src/map/script.c

@@ -13082,7 +13082,7 @@ BUILDIN_FUNC(setitemscript)
 		n=script_getnum(st,4);
 	i_data = itemdb_exists(item_id);
 
-	if (!i_data || script==NULL || script[0]!='{') {
+	if (!i_data || script==NULL || ( script[0] && script[0]!='{' )) {
 		script_pushint(st,0);
 		return 0;
 	}
@@ -13100,7 +13100,7 @@ BUILDIN_FUNC(setitemscript)
 	if(*dstscript)
 		script_free_code(*dstscript);
 
-	*dstscript = parse_script(script, "script_setitemscript", 0, 0);
+	*dstscript = script[0] ? parse_script(script, "script_setitemscript", 0, 0) : NULL;
 	script_pushint(st,1);
 	return 0;
 }