fix trade reject

This commit is contained in:
Johannes Schmelz 2024-12-01 02:07:39 +01:00
parent f3ec17b0b1
commit 4af08ffffd

View File

@ -256,9 +256,12 @@ public class ServerGameLogic implements ClientInterpreter {
TradeHandler tradeHandler = msg.getTradeHandler(); TradeHandler tradeHandler = msg.getTradeHandler();
Player receiver = playerHandler.getPlayerById(tradeHandler.getReceiver().getId()); Player receiver = playerHandler.getPlayerById(tradeHandler.getReceiver().getId());
Player sender = playerHandler.getPlayerById(tradeHandler.getSender().getId()); Player sender = playerHandler.getPlayerById(tradeHandler.getSender().getId());
if(msg.isAccepted()) {
Set<PropertyField> offered = new HashSet<>(); Set<PropertyField> offered = new HashSet<>();
for (PropertyField propertyField : tradeHandler.getOfferedProperties()) { for (PropertyField propertyField : tradeHandler.getOfferedProperties()) {
@ -287,7 +290,7 @@ public class ServerGameLogic implements ClientInterpreter {
sender.addJailCard(); sender.addJailCard();
receiver.removeJailCard(); receiver.removeJailCard();
} }
}
updateAllPlayers(); updateAllPlayers();
if (receiver != null && sender != null) { if (receiver != null && sender != null) {