From a0c373bec6af6f768c07bda85a0a567b802571be Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 16 Feb 2022 00:26:15 -0500 Subject: [PATCH] Fixed crash --- core/src/mindustry/ai/ControlPathfinder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/ai/ControlPathfinder.java b/core/src/mindustry/ai/ControlPathfinder.java index 3110cb20e4..5a52a07055 100644 --- a/core/src/mindustry/ai/ControlPathfinder.java +++ b/core/src/mindustry/ai/ControlPathfinder.java @@ -92,7 +92,8 @@ public class ControlPathfinder{ for(var req : requests.values()){ //skipped N update -> drop it if(req.lastUpdateId <= state.updateId - 10){ - requests.remove(req.unit); + //concurrent modification! + Core.app.post(() -> requests.remove(req.unit)); req.thread.queue.post(() -> req.thread.requests.remove(req)); } }