From 2cac373afe419680b710e9a737e9b1a36fc8e9b3 Mon Sep 17 00:00:00 2001 From: ntr Date: Fri, 8 Nov 2019 11:05:05 +1100 Subject: [PATCH] fixed cooldown bug by filtering all resolved skills and checking for cd --- server/src/game.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server/src/game.rs b/server/src/game.rs index e3b3a6f5..960088cd 100644 --- a/server/src/game.rs +++ b/server/src/game.rs @@ -508,12 +508,10 @@ impl Game { // only reduce cooldowns if no cd was used // have to borrow self for the skill check { - if let Some(skill) = resolved.iter().find(|s| s.source_construct_id == construct.id) { - if skill.used_cooldown() { + if let Some(skill) = resolved.iter() + .filter(|s| s.source_construct_id == construct.id) + .find(|s| s.used_cooldown()) { construct.skill_set_cd(skill.skill); - } else { - construct.reduce_cooldowns(); - } } else { construct.reduce_cooldowns(); }