From 549fa1a065a021b1c2530b38a475bdc764ba4790 Mon Sep 17 00:00:00 2001 From: Cardillan <122014763+cardillan@users.noreply.github.com> Date: Fri, 18 Jul 2025 00:45:47 +0200 Subject: [PATCH] Setting null to counter should be a no-op (#11012) --- core/src/mindustry/logic/LVar.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/logic/LVar.java b/core/src/mindustry/logic/LVar.java index 5312003eb1..ef3b36ef8b 100644 --- a/core/src/mindustry/logic/LVar.java +++ b/core/src/mindustry/logic/LVar.java @@ -103,8 +103,12 @@ public class LVar{ public void set(LVar other){ isobj = other.isobj; - objval = other.objval; - numval = other.numval; + // Setting a non-numeric value to @counter must preserve its numeric field + if(isobj){ + objval = other.objval; + }else{ + numval = other.numval; + } } public static boolean invalid(double d){