Browse Source

Fixed warping in OnPCDieEvent revives people with 0 hp.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14174 54d463be-8e91-2dee-dedb-b68131a5f0ec
Inkfish 15 years ago
parent
commit
80591b2611
2 changed files with 10 additions and 10 deletions
  1. 1 0
      Changelog-Trunk.txt
  2. 9 10
      src/map/pc.c

+ 1 - 0
Changelog-Trunk.txt

@@ -10,6 +10,7 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 	- removed the 'feature' that events only trigger when the player is in the OnTouch area IF it's specified. 
 	- removed the 'feature' that events only trigger when the player is in the OnTouch area IF it's specified. 
 		It's never documented and breaks official scripts.
 		It's never documented and breaks official scripts.
 	- some cleanups and bug fixes to OnTouch_.
 	- some cleanups and bug fixes to OnTouch_.
+	* Fixed warping in OnPCDieEvent revives people with 0 hp.
 2009/11/25
 2009/11/25
 	* Fixed strnpcinfo(1) returning blank strings when NPC names did not have a hidden portion of the display name. (bugreport:3758) [Paradox924X]
 	* Fixed strnpcinfo(1) returning blank strings when NPC names did not have a hidden portion of the display name. (bugreport:3758) [Paradox924X]
 2009/11/23
 2009/11/23

+ 9 - 10
src/map/pc.c

@@ -5481,15 +5481,6 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
 			duel_reject(sd->duel_invite, sd);
 			duel_reject(sd->duel_invite, sd);
 	}
 	}
 
 
-	pc_setdead(sd);
-	//Reset menu skills/item skills
-	if (sd->skillitem)
-		sd->skillitem = sd->skillitemlv = 0;
-	if (sd->menuskill_id)
-		sd->menuskill_id = sd->menuskill_val = 0;
-	//Reset ticks.
-	sd->hp_loss.tick = sd->sp_loss.tick = sd->hp_regen.tick = sd->sp_regen.tick = 0;
-
 	pc_setglobalreg(sd,"PC_DIE_COUNTER",sd->die_counter+1);
 	pc_setglobalreg(sd,"PC_DIE_COUNTER",sd->die_counter+1);
 	pc_setglobalreg(sd,"killerrid",src?src->id:0);
 	pc_setglobalreg(sd,"killerrid",src?src->id:0);
 	if( sd->state.bg_id )
 	if( sd->state.bg_id )
@@ -5498,9 +5489,17 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
 		if( (bg = bg_team_search(sd->state.bg_id)) != NULL && bg->die_event[0] )
 		if( (bg = bg_team_search(sd->state.bg_id)) != NULL && bg->die_event[0] )
 			npc_event(sd, bg->die_event, 0);
 			npc_event(sd, bg->die_event, 0);
 	}
 	}
-
 	npc_script_event(sd,NPCE_DIE);
 	npc_script_event(sd,NPCE_DIE);
 
 
+	pc_setdead(sd);
+	//Reset menu skills/item skills
+	if (sd->skillitem)
+		sd->skillitem = sd->skillitemlv = 0;
+	if (sd->menuskill_id)
+		sd->menuskill_id = sd->menuskill_val = 0;
+	//Reset ticks.
+	sd->hp_loss.tick = sd->sp_loss.tick = sd->hp_regen.tick = sd->sp_regen.tick = 0;
+
 	if ( sd && sd->spiritball )
 	if ( sd && sd->spiritball )
 		pc_delspiritball(sd,sd->spiritball,0);
 		pc_delspiritball(sd,sd->spiritball,0);