From 148f1131248a6c605c2b9875b6f742db01554c47 Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 24 Jul 2018 19:55:01 +0200 Subject: 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 --- src/map/pc.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/map/pc.c') 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); -- cgit v1.2.3-60-g2f50