summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2019-12-01 05:59:01 +0100
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2019-12-01 05:59:01 +0100
commitac8cc41df6d16e1508cfd81271564afe76431eff (patch)
tree01b4a3e72f13154fd45f8437252c73a766a7ffdf /src/map
parent7d5ce7b3a33fb27cf838d863b8f017220abb624a (diff)
downloadhercules-ac8cc41df6d16e1508cfd81271564afe76431eff.tar.gz
hercules-ac8cc41df6d16e1508cfd81271564afe76431eff.tar.bz2
hercules-ac8cc41df6d16e1508cfd81271564afe76431eff.tar.xz
hercules-ac8cc41df6d16e1508cfd81271564afe76431eff.zip
Modified skill_cooldown_save() to ignore guild skills if guild_skill_relog_delay is set to 1.
If guild skills are not ignored when guild_skill_relog_delay is set to 1, the map server will throw error messages if the guild master relogs while cooldown. Also applied Hercules coding style to skill_cooldown_save(). See https://github.com/HerculesWS/Hercules/issues/2591
Diffstat (limited to 'src/map')
-rw-r--r--src/map/skill.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index e2d76fb8b..3a3026ee7 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -19758,23 +19758,23 @@ static int skill_get_elemental_type(uint16 skill_id, uint16 skill_lv)
static void skill_cooldown_save(struct map_session_data *sd)
{
int i;
- struct skill_cd* cd = NULL;
+ struct skill_cd *cd = NULL;
int64 now = 0;
- // always check to make sure the session properly exists
nullpo_retv(sd);
- if( !(cd = idb_get(skill->cd_db, sd->status.char_id)) ) {// no skill cooldown is associated with this character
+ if ((cd = idb_get(skill->cd_db, sd->status.char_id)) == NULL)
return;
- }
now = timer->gettick();
- // process each individual cooldown associated with the character
- for( i = 0; i < cd->cursor; i++ ) {
- cd->entry[i]->duration = DIFF_TICK32(cd->entry[i]->started+cd->entry[i]->duration,now);
- if( cd->entry[i]->timer != INVALID_TIMER ) {
- timer->delete(cd->entry[i]->timer,skill->blockpc_end);
+ for (i = 0; i < cd->cursor; i++) {
+ if (battle_config.guild_skill_relog_delay == 1 && cd->entry[i]->skill_id > GD_SKILLBASE && cd->entry[i]->skill_id < GD_MAX)
+ continue;
+
+ cd->entry[i]->duration = DIFF_TICK32(cd->entry[i]->started + cd->entry[i]->duration, now);
+ if (cd->entry[i]->timer != INVALID_TIMER) {
+ timer->delete(cd->entry[i]->timer, skill->blockpc_end);
cd->entry[i]->timer = INVALID_TIMER;
}
}