From 446ce4a3179163fbdef68b39c69db3943222698c Mon Sep 17 00:00:00 2001 From: panikon Date: Sat, 19 Apr 2014 00:21:33 -0300 Subject: #Fixed issue: 8147 * http://hercules.ws/board/tracker/issue-8147-map-zone-dbconf-pvpon-crash/ #Added check to prevent issue where player would start autotrading from savepoint if killed in a map where pvp/gvg was active --- src/map/pc.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/map/pc.c') diff --git a/src/map/pc.c b/src/map/pc.c index afb06527d..9ee65d2d2 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -6833,13 +6833,14 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) { int i=0,j=0; int64 tick = timer->gettick(); - for(j = 0; j < 5; j++) + for(j = 0; j < 5; j++) { if (sd->devotion[j]){ struct map_session_data *devsd = map->id2sd(sd->devotion[j]); if (devsd) status_change_end(&devsd->bl, SC_DEVOTION, INVALID_TIMER); sd->devotion[j] = 0; } + } if(sd->status.pet_id > 0 && sd->pd) { struct pet_data *pd = sd->pd; @@ -7137,6 +7138,17 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) { } } } + + // Remove autotrade to prevent autotrading from save point + if( sd->state.standalone || sd->state.autotrade + && (map->list[sd->bl.m].flag.pvp || map->list[sd->bl.m].flag.gvg) + ) { + sd->state.autotrade = 0; + sd->state.standalone = 0; + pc->autotrade_update(sd,PAUC_REMOVE); + map->quit(sd); + } + // pvp // disable certain pvp functions on pk_mode [Valaris] if( map->list[sd->bl.m].flag.pvp && !battle_config.pk_mode && !map->list[sd->bl.m].flag.pvp_nocalcrank ) { @@ -7166,10 +7178,10 @@ int pc_dead(struct map_session_data *sd,struct block_list *src) { } } - //Reset "can log out" tick. if( battle_config.prevent_logout ) sd->canlog_tick = timer->gettick() - battle_config.prevent_logout; + return 1; } -- cgit v1.2.3-60-g2f50