fix: fixed bug where winner was not declared in WinEvent

This commit is contained in:
Yannik Bretschneider 2021-06-07 17:47:04 +02:00
parent 3c49c5bbd8
commit 0248eaf154
1 changed files with 2 additions and 2 deletions

View File

@ -292,9 +292,9 @@ public class Lobby {
connection.broadcastEvents(
new EventBuilder(EventType.WinEvent)
.withPlayerWon(winner.type.equals(ParticipantType.PlayerOne) ? 1 : 2)
.buildGameStateEvent(),
.buildGameEvent(),
new EventBuilder(EventType.DisconnectEvent)
.buildGameStateEvent());
.buildGameEvent());
connection.terminate();
}