From 1438ae5e4ff0d283b2a7491b3184dfc5527e3e7f Mon Sep 17 00:00:00 2001 From: Johannes Schmelz Date: Fri, 29 Nov 2024 06:26:09 +0100 Subject: [PATCH] improve position calc --- .../client/src/main/java/pp/monopoly/client/gui/TestWorld.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TestWorld.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TestWorld.java index 06612bf..3bc64bf 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TestWorld.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/TestWorld.java @@ -133,7 +133,7 @@ public class TestWorld implements GameEventListener{ @Override public void receivedEvent(PopUpEvent event) { if(event.msg().equals("Buy")) { - int field = app.getGameLogic().getPlayerHandler().getPlayers().get(0).getFieldID(); + int field = app.getGameLogic().getPlayerHandler().getPlayerById(app.getId()).getFieldID(); Object fieldObject = app.getGameLogic().getBoardManager().getFieldAtIndex(field); if (fieldObject instanceof BuildingProperty) {