mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-19 06:06:15 +01:00
fix trade reject
This commit is contained in:
parent
f3ec17b0b1
commit
4af08ffffd
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user