Follow up r15732, Fixed bug where a player killed by a method not passing thru pc_damage (e.g. poison/@die) would leave sitting icon active even while dead. Thanks to wildcard and epoque

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15733 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
shennetsind 2012-03-19 20:06:03 +00:00
parent 07d301cd6d
commit fcb46867e4

View File

@ -6032,18 +6032,16 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
unsigned int tick = gettick(); unsigned int tick = gettick();
for(k = 0; k < 5; k++) for(k = 0; k < 5; k++)
if (sd->devotion[k]){ if (sd->devotion[k]){
struct map_session_data *devsd = map_id2sd(sd->devotion[k]); struct map_session_data *devsd = map_id2sd(sd->devotion[k]);
if (devsd) if (devsd)
status_change_end(&devsd->bl, SC_DEVOTION, INVALID_TIMER); status_change_end(&devsd->bl, SC_DEVOTION, INVALID_TIMER);
sd->devotion[k] = 0; sd->devotion[k] = 0;
} }
if(sd->status.pet_id > 0 && sd->pd) if(sd->status.pet_id > 0 && sd->pd) {
{
struct pet_data *pd = sd->pd; struct pet_data *pd = sd->pd;
if( !map[sd->bl.m].flag.noexppenalty ) if( !map[sd->bl.m].flag.noexppenalty ) {
{
pet_set_intimate(pd, pd->pet.intimate - pd->petDB->die); pet_set_intimate(pd, pd->pet.intimate - pd->petDB->die);
if( pd->pet.intimate < 0 ) if( pd->pet.intimate < 0 )
pd->pet.intimate = 0; pd->pet.intimate = 0;
@ -6069,14 +6067,20 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
pc_setglobalreg(sd,"PC_DIE_COUNTER",sd->die_counter+1); pc_setglobalreg(sd,"PC_DIE_COUNTER",sd->die_counter+1);
pc_setparam(sd, SP_KILLERRID, src?src->id:0); pc_setparam(sd, SP_KILLERRID, src?src->id:0);
if( sd->bg_id )
{ if( sd->bg_id ) {
struct battleground_data *bg; struct battleground_data *bg;
if( (bg = bg_team_search(sd->bg_id)) != NULL && bg->die_event[0] ) if( (bg = bg_team_search(sd->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);
/* e.g. not killed thru pc_damage */
if( pc_issit(sd) ) {
clif_status_load(&sd->bl,SI_SITTING,0);
}
pc_setdead(sd); pc_setdead(sd);
//Reset menu skills/item skills //Reset menu skills/item skills
if (sd->skillitem) if (sd->skillitem)