summaryrefslogtreecommitdiff
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
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
-rw-r--r--src/map/map.c3
-rw-r--r--src/map/pc.c16
2 files changed, 15 insertions, 4 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 7adeee3d5..04ac8a239 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -3765,10 +3765,9 @@ struct map_zone_data *map_merge_zone(struct map_zone_data *main, struct map_zone
CREATE(zone->capped_skills, struct map_zone_skill_damage_cap_entry *, zone->capped_skills_count);
-
for(i = 0, cursor = 0; i < main->capped_skills_count; i++, cursor++ ) {
CREATE(zone->capped_skills[cursor], struct map_zone_skill_damage_cap_entry, 1);
- memcpy(zone->capped_skills[cursor], main->disabled_commands[i], sizeof(struct map_zone_skill_damage_cap_entry));
+ memcpy(zone->capped_skills[cursor], main->capped_skills[i], sizeof(struct map_zone_skill_damage_cap_entry));
}
for(i = 0; i < other->capped_skills_count; i++, cursor++ ) {
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;
}