summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-07-24 19:55:01 +0200
committerHaru <haru@dotalux.com>2018-07-26 01:12:19 +0200
commit148f1131248a6c605c2b9875b6f742db01554c47 (patch)
tree224630e55dee3927292f644f440ffdd304a8b0a0
parent40f015d43eb87a6680b4ce53b1ca88c0dec641e3 (diff)
downloadhercules-148f1131248a6c605c2b9875b6f742db01554c47.tar.gz
hercules-148f1131248a6c605c2b9875b6f742db01554c47.tar.bz2
hercules-148f1131248a6c605c2b9875b6f742db01554c47.tar.xz
hercules-148f1131248a6c605c2b9875b6f742db01554c47.zip
Fix an issue that causes skill cooldowns to get stuck indefinitely
A cooldown timer could expire before the associated character's data gets added to the ID/PC DB, causing skill_blockpc_end() to be unable to find and clear the cooldown data. This commit moves the cooldown loading function to a safe place, after the character data is initialized and added to the DB. Fixes #1535 Signed-off-by: Haru <haru@dotalux.com>
-rw-r--r--src/map/pc.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index d89abcca8..d8a1c0b0e 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1405,16 +1405,6 @@ static bool pc_authok(struct map_session_data *sd, int login_id2, time_t expirat
clif->changemap(sd,sd->bl.m,sd->bl.x,sd->bl.y);
}
- /**
- * Check if player have any cool downs on
- **/
- skill->cooldown_load(sd);
-
- /**
- * Check if player have any item cooldowns on
- **/
- pc->itemcd_do(sd,true);
-
#ifdef GP_BOUND_ITEMS
if( sd->status.party_id == 0 )
pc->bound_clear(sd,IBT_PARTY);
@@ -1554,6 +1544,10 @@ static int pc_reg_received(struct map_session_data *sd)
if (!chrif->auth_finished(sd))
ShowError("pc_reg_received: Failed to properly remove player %d:%d from logging db!\n", sd->status.account_id, sd->status.char_id);
+ // Restore any cooldowns
+ skill->cooldown_load(sd);
+ pc->itemcd_do(sd, true);
+
pc->load_combo(sd);
status_calc_pc(sd,SCO_FIRST|SCO_FORCE);