From 4472045b41c5b0d0d4b5eff57b0c4ef5c328bc06 Mon Sep 17 00:00:00 2001 From: hiddevanesch Date: Wed, 5 Apr 2023 12:04:31 +0200 Subject: [PATCH] Fixed bug with lamps --- .idea/workspace.xml | 8 +++----- src/main/java/nl/group5b/gui/elements/MainPanel.java | 3 +++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b867256..2fc50d5 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,10 +6,7 @@ - - - - + diff --git a/src/main/java/nl/group5b/gui/elements/MainPanel.java b/src/main/java/nl/group5b/gui/elements/MainPanel.java index 5c5de95..0936aee 100644 --- a/src/main/java/nl/group5b/gui/elements/MainPanel.java +++ b/src/main/java/nl/group5b/gui/elements/MainPanel.java @@ -377,6 +377,9 @@ private void renderVehicleData(float contentWidth) throws FileNotFoundException if (selectedVehicleHasLamp) { Lamp attachableLamp = selectedVehicle.getLamp(); selectedVehicle.removeLamp(); + if (selectedLamp == attachableLamp) { + selectedLamp = null; + } bodies.remove(attachableLamp); lights.remove(attachableLamp.getLight()); shader.recompile(lights.size());