push new empty events vec on resolve phase start

This commit is contained in:
Mashy 2019-12-05 23:52:50 +10:00
parent 70711fd37b
commit b62dc53e08
2 changed files with 4 additions and 4 deletions

View File

@ -86,7 +86,7 @@ function registerEvents(store) {
store.dispatch(actions.setAnimating(true));
store.dispatch(actions.setGameSkillInfo(null));
// stop fetching the game state til animations are done
const newRes = game.events[currentGame.events.length - 1];
const newRes = game.events[currentGame.events.length];
return eachSeries(newRes, (r, cb) => {
const timeout = r.delay;
const anims = animations.getObjects(r, game, account);

View File

@ -191,9 +191,7 @@ impl Game {
}
fn skill_phase_start(mut self, resolution_animation_ms: i64) -> Game {
self.events.push(vec![]);
self.phase_start = Utc::now()
self.phase_start = Utc::now()
.checked_add_signed(Duration::milliseconds(resolution_animation_ms))
.expect("could not set phase start");
@ -415,6 +413,8 @@ impl Game {
}
pub fn resolve_phase_start(mut self) -> Game {
self.events.push(vec![]);
if self.phase != Phase::Skill {
panic!("game not in skill phase");
}