summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-06-06 17:30:09 -0300
committershennetsind <ind@henn.et>2013-06-06 17:30:09 -0300
commitf754643911ebb19eb68fb7b6ad1a864b02d111a8 (patch)
tree50402796ebc29ca0b1df47cf9e96b9f4687be12f /src/map
parent71ac5d07a0d18dc56b73ebc2b2ae095eacd25241 (diff)
downloadhercules-f754643911ebb19eb68fb7b6ad1a864b02d111a8.tar.gz
hercules-f754643911ebb19eb68fb7b6ad1a864b02d111a8.tar.bz2
hercules-f754643911ebb19eb68fb7b6ad1a864b02d111a8.tar.xz
hercules-f754643911ebb19eb68fb7b6ad1a864b02d111a8.zip
Fixed "Unable to restore stack! Double continuation" Error
Special Thanks to lighta for pointing it out. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map')
-rw-r--r--src/map/pc.c72
1 files changed, 37 insertions, 35 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index f6ee257bd..2587cfc8f 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -6594,8 +6594,7 @@ void pc_damage(struct map_session_data *sd,struct block_list *src,unsigned int h
/*==========================================
* Invoked when a player has negative current hp
*------------------------------------------*/
-int pc_dead(struct map_session_data *sd,struct block_list *src)
-{
+int pc_dead(struct map_session_data *sd,struct block_list *src) {
int i=0,j=0,k=0;
unsigned int tick = gettick();
@@ -6638,6 +6637,9 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
duel_reject(sd->duel_invite, sd);
}
+ if (sd->npc_id)
+ npc_event_dequeue(sd);
+
pc_setglobalreg(sd,"PC_DIE_COUNTER",sd->die_counter+1);
pc_setparam(sd, SP_KILLERRID, src?src->id:0);
@@ -6691,43 +6693,43 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
for(i = 1; i < 5; i++)
pc_del_talisman(sd, sd->talisman[i], i);
- if (src)
- switch (src->type) {
- case BL_MOB:
- {
- struct mob_data *md=(struct mob_data *)src;
- if(md->target_id==sd->bl.id)
- mob_unlocktarget(md,tick);
- if(battle_config.mobs_level_up && md->status.hp &&
- (unsigned int)md->level < pc_maxbaselv(sd) &&
- !md->guardian_data && !md->special_state.ai// Guardians/summons should not level. [Skotlex]
- ) { // monster level up [Valaris]
- clif->misceffect(&md->bl,0);
- md->level++;
- status_calc_mob(md, 0);
- status_percent_heal(src,10,0);
-
- if( battle_config.show_mob_info&4 )
- {// update name with new level
- clif->charnameack(0, &md->bl);
+ if (src) {
+ switch (src->type) {
+ case BL_MOB:
+ {
+ struct mob_data *md=(struct mob_data *)src;
+ if(md->target_id==sd->bl.id)
+ mob_unlocktarget(md,tick);
+ if(battle_config.mobs_level_up && md->status.hp &&
+ (unsigned int)md->level < pc_maxbaselv(sd) &&
+ !md->guardian_data && !md->special_state.ai// Guardians/summons should not level. [Skotlex]
+ ) { // monster level up [Valaris]
+ clif->misceffect(&md->bl,0);
+ md->level++;
+ status_calc_mob(md, 0);
+ status_percent_heal(src,10,0);
+
+ if( battle_config.show_mob_info&4 )
+ {// update name with new level
+ clif->charnameack(0, &md->bl);
+ }
+ }
+ src = battle->get_master(src); // Maybe Player Summon
}
+ break;
+ case BL_PET: //Pass on to master...
+ src = &((TBL_PET*)src)->msd->bl;
+ break;
+ case BL_HOM:
+ src = &((TBL_HOM*)src)->master->bl;
+ break;
+ case BL_MER:
+ src = &((TBL_MER*)src)->master->bl;
+ break;
}
- src = battle->get_master(src); // Maybe Player Summon
- }
- break;
- case BL_PET: //Pass on to master...
- src = &((TBL_PET*)src)->msd->bl;
- break;
- case BL_HOM:
- src = &((TBL_HOM*)src)->master->bl;
- break;
- case BL_MER:
- src = &((TBL_MER*)src)->master->bl;
- break;
}
- if (src && src->type == BL_PC)
- {
+ if (src && src->type == BL_PC) {
struct map_session_data *ssd = (struct map_session_data *)src;
pc_setparam(ssd, SP_KILLEDRID, sd->bl.id);
npc_script_event(ssd, NPCE_KILLPC);