From e7a680248854be09de88f4eb26924dae83ff044c Mon Sep 17 00:00:00 2001 From: Johannes Schmelz Date: Sun, 24 Nov 2024 19:14:56 +0100 Subject: [PATCH] fixed buyProperty --- .../model/src/main/java/pp/monopoly/game/server/Player.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java index 7dc6fab..c9d43d8 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java @@ -168,6 +168,7 @@ public class Player implements FieldVisitor{ public void buyProperty(PropertyField property) { if (property.getOwner() == null && accountBalance >= property.getPrice()) { properties.add(property); + property.setOwner(this); pay(property.getPrice()); } }