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

View File

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