Просмотр исходного кода

- Corrected a crash when sd is null in npc_event

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6440 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 лет назад
Родитель
Сommit
4382529413
2 измененных файлов с 4 добавлено и 1 удалено
  1. 1 0
      Changelog-Trunk.txt
  2. 3 1
      src/map/npc.c

+ 1 - 0
Changelog-Trunk.txt

@@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 2006/05/01
+	* Corrected a crash when sd is null in npc_event [Skotlex]
 	* After testing to make sure it works properly, I'm including
 	  new battle conf options to limit MVP drops. [Reddozen]
 	* Removed OPTION_XMAS, it seems to not exist.... [Skotlex]

+ 3 - 1
src/map/npc.c

@@ -822,8 +822,10 @@ int npc_event (struct map_session_data *sd, const unsigned char *eventname, int
 	int xs,ys;
 	unsigned char mobevent[100];
 
-	if (sd == NULL)
+	if (sd == NULL) {
 		nullpo_info(NLP_MARK);
+		return 0;
+	}
 
 	if (ev == NULL && eventname && strcmp(((eventname)+strlen(eventname)-9),"::OnTouch") == 0)
 		return 1;