fixed cooldown bug by filtering all resolved skills and checking for cd

This commit is contained in:
ntr 2019-11-08 11:05:05 +11:00
parent a4b0fc0c4f
commit 2cac373afe

View File

@ -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();
}