فهرست منبع

* Fixed a crash, when script command 'doevent' is called without an attached player (bugreport:3973).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14601 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei 14 سال پیش
والد
کامیت
89dc57acdc
2فایلهای تغییر یافته به همراه9 افزوده شده و 1 حذف شده
  1. 1 0
      Changelog-Trunk.txt
  2. 8 1
      src/map/script.c

+ 1 - 0
Changelog-Trunk.txt

@@ -1,6 +1,7 @@
 Date	Added
 
 2010/12/17
+	* Fixed a crash, when script command 'doevent' is called without an attached player (bugreport:3973). [Ai4rei]
 	* Fixed label definitions silently overwriting built-in script functions (bugreport:2806, follow up to r8027). [Ai4rei]
 	* Added temporary check to skill_delunitgroup to prevent crashes when 'group' is NULL and added some debug messages to track down the source of the crash (bugreport:3504). [Ai4rei]
 	* Spellchecked script_commands.txt. [Ai4rei]

+ 8 - 1
src/map/script.c

@@ -7848,8 +7848,15 @@ BUILDIN_FUNC(clone)
 BUILDIN_FUNC(doevent)
 {
 	const char* event = script_getstr(st,2);
+	struct map_session_data* sd;
+
+	if( ( sd = script_rid2sd(st) ) == NULL )
+	{
+		return 0;
+	}
+
 	check_event(st, event);
-	npc_event(map_id2sd(st->rid),event,0);
+	npc_event(sd, event, 0);
 	return 0;
 }
 /*==========================================