summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorpanikon <panikon@zoho.com>2014-04-19 00:21:33 -0300
committerpanikon <panikon@zoho.com>2014-04-19 00:21:33 -0300
commit446ce4a3179163fbdef68b39c69db3943222698c (patch)
tree93b3400af1a1b0946f9be07e62b60a82e68b6dc0 /src/map/pc.c
parent69ca0aaecc5823dfe273810077c185dff7f20611 (diff)
downloadhercules-446ce4a3179163fbdef68b39c69db3943222698c.tar.gz
hercules-446ce4a3179163fbdef68b39c69db3943222698c.tar.bz2
hercules-446ce4a3179163fbdef68b39c69db3943222698c.tar.xz
hercules-446ce4a3179163fbdef68b39c69db3943222698c.zip
#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
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c16
1 files changed, 14 insertions, 2 deletions
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;
}