fix: updated timeout-method for spectator-error

This commit is contained in:
Richard Reiber 2021-06-06 00:49:09 +02:00
parent 6a8de34c67
commit c1cd3fba66

View File

@ -147,10 +147,10 @@ public class Lobby {
new EventBuilder(EventType.TimeoutEvent).buildGameStateEvent()); new EventBuilder(EventType.TimeoutEvent).buildGameStateEvent());
connection.removeParticipant(source); connection.removeParticipant(source);
if(connection.hasPlayer1()){ if(connection.hasPlayer1() && !connection.hasPlayer2()){
generateWin(connection.getPlayer1()); generateWin(connection.getPlayer1());
} }
else if(connection.hasPlayer2()) { else if(!connection.hasPlayer1() && connection.hasPlayer2()) {
generateWin(connection.getPlayer2()); generateWin(connection.getPlayer2());
} }
else { else {