From 8502c527e30229beb61f5dfedea52a2370a22ff6 Mon Sep 17 00:00:00 2001 From: Timo Ley Date: Tue, 26 Mar 2024 14:11:50 +0100 Subject: [PATCH] fix: prevent infinite loop in some conditions --- src/main/java/appeng/tile/legacy/TileLegacyController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/appeng/tile/legacy/TileLegacyController.java b/src/main/java/appeng/tile/legacy/TileLegacyController.java index 2e1ea73b..bb18ceb5 100644 --- a/src/main/java/appeng/tile/legacy/TileLegacyController.java +++ b/src/main/java/appeng/tile/legacy/TileLegacyController.java @@ -267,7 +267,11 @@ public class TileLegacyController extends AENetworkPowerTile implements ILocatab public void removeCPUs() { boolean changed = false; while (this.inactiveCPUs > MIN_INACTIVE) { - changed = changed || removeLastIfNotBusy(); + if (removeLastIfNotBusy()) { + changed = true; + } else { + break; + } } if (changed) { try {