scope block, add warden total resolution delay

This commit is contained in:
Mashy 2019-12-10 17:49:11 +10:00
parent 47b92a5b80
commit 4fe01c6774

View File

@ -437,9 +437,6 @@ impl Game {
let mut r_animation_ms = 0; let mut r_animation_ms = 0;
while let Some(cast) = self.stack.pop() { while let Some(cast) = self.stack.pop() {
// info!("{:} casts ", cast); // info!("{:} casts ", cast);
// r_animation_ms = Resolutions.iter().fold(r_animation_ms, |acc, r| acc + r.clone().get_delay());
// if theres no resolution Resolutions, the skill didn't trigger (disable etc) // if theres no resolution Resolutions, the skill didn't trigger (disable etc)
// if Resolutions.len() > 0 && cast.used_cooldown() { // if Resolutions.len() > 0 && cast.used_cooldown() {
// casters.push(cast); // casters.push(cast);
@ -452,10 +449,13 @@ impl Game {
}; };
// go through the whole most recent round and modify delays of the resolutions // go through the whole most recent round and modify delays of the resolutions
let last = self.resolutions.len() - 1; {
let mut iter = self.resolutions[last].iter_mut().peekable(); let last = self.resolutions.len() - 1;
while let Some(res) = iter.next() { let mut iter = self.resolutions[last].iter_mut().peekable();
res.set_delay(iter.peek()); while let Some(res) = iter.next() {
res.set_delay(iter.peek());
r_animation_ms += res.delay;
}
} }
// info!("{:#?}", self.casts); // info!("{:#?}", self.casts);