Explorar o código

Fixed mob is removed from map right after his rebirth.
Fixed dead event does not trigger when a mob has rebirth skill and dies for the second time.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14136 54d463be-8e91-2dee-dedb-b68131a5f0ec

Inkfish %!s(int64=15) %!d(string=hai) anos
pai
achega
c9c033cea3
Modificáronse 2 ficheiros con 8 adicións e 3 borrados
  1. 3 0
      Changelog-Trunk.txt
  2. 5 3
      src/map/mob.c

+ 3 - 0
Changelog-Trunk.txt

@@ -3,6 +3,9 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+09/11/09
+	* Fixed mob is removed from map right after his rebirth. [Inkfish]
+	* Fixed dead event does not trigger when a mob has rebirth skill and dies for the second time. [Inkfish]
 09/11/08
 	* Added a flag to indicate if the script of an autobonus was parsed for the sake of resourse saving. [Inkfish]
 09/11/04

+ 5 - 3
src/map/mob.c

@@ -1954,6 +1954,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 	int i,temp,count,pnum=0,m=md->bl.m;
 	unsigned int mvp_damage, tick = gettick();
 	unsigned short flaghom = 1; // [Zephyrus] Does the mob only received damage from homunculus?
+	bool rebirth = ( md->sc.data[SC_KAIZEL] || (md->sc.data[SC_REBIRTH] && !md->state.rebirth) );
 
 	status = &md->status;
 
@@ -2370,7 +2371,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 	  	//Emperium destroyed by script. Discard mvp character. [Skotlex]
 		mvp_sd = NULL;
 
-	if( !md->sc.data[SC_KAIZEL] && !md->sc.data[SC_REBIRTH] )
+	if( !rebirth )
 	{ // Only trigger event on final kill
 		md->status.hp = 0; //So that npc_event invoked functions KNOW that mob is dead
 		if( src )
@@ -2424,8 +2425,9 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
 
 	if(!md->spawn) //Tell status_damage to remove it from memory.
 		return 5; // Note: Actually, it's 4. Oh well...
-	
-	mob_setdelayspawn(md); //Set respawning.
+
+	if( !rebirth )
+		mob_setdelayspawn(md); //Set respawning.
 	return 3; //Remove from map.
 }