fix: include gamestate events in applying to ensure the state is set correctly

This commit is contained in:
punchready 2021-07-29 01:01:51 +02:00
parent 0fb3ca8728
commit 0336e4769a

View File

@ -116,19 +116,17 @@ class GameStateManager {
GameState snapshot = state.snapshot(); GameState snapshot = state.snapshot();
ArrayList<Event> result = GameLogic.startGame(snapshot, selectedCharacters1, selectedCharacters2); ArrayList<Event> result = GameLogic.startGame(snapshot, selectedCharacters1, selectedCharacters2);
applyEvents(result);
result.add(GameLogic.buildGameStateEvent(state)); result.add(GameLogic.buildGameStateEvent(state));
applyEvents(result);
snapshot = state.snapshot(); snapshot = state.snapshot();
ArrayList<Event> result2 = GameLogic.startRound(snapshot); ArrayList<Event> result2 = GameLogic.startRound(snapshot);
result.add(GameLogic.buildGameStateEvent(state));
applyEvents(result2); applyEvents(result2);
result.addAll(result2); result.addAll(result2);
result.add(GameLogic.buildGameStateEvent(state));
return result; return result;
} }