From f6c97f4ff6064def93e9c30ee8bde43e2ce13bc7 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 16 Jan 2023 11:06:34 -0500 Subject: [PATCH] Fixed #8185 --- core/src/mindustry/entities/EntityGroup.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/entities/EntityGroup.java b/core/src/mindustry/entities/EntityGroup.java index b3f5fad050..ad97cb93b5 100644 --- a/core/src/mindustry/entities/EntityGroup.java +++ b/core/src/mindustry/entities/EntityGroup.java @@ -206,7 +206,7 @@ public class EntityGroup implements Iterable{ //fix incorrect HEAD index since it was swapped if(array.size > 0 && idx != array.size){ var swapped = array.items[idx]; - indexer.change(swapped, idx); + if(indexer != null) indexer.change(swapped, idx); } if(map != null){ @@ -228,7 +228,7 @@ public class EntityGroup implements Iterable{ //swap head with current if(array.size > 1){ var head = array.items[array.size - 1]; - indexer.change(head, position); + if(indexer != null) indexer.change(head, position); array.items[position] = head; }