From 279d898d68b020256ee5d8fa8e4dc1ae25727dcf Mon Sep 17 00:00:00 2001 From: DeltaNedas <39013340+DeltaNedas@users.noreply.github.com> Date: Sat, 24 Oct 2020 16:37:55 +0000 Subject: [PATCH 1/4] add more info to print object --- core/src/mindustry/logic/LExecutor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/logic/LExecutor.java b/core/src/mindustry/logic/LExecutor.java index a4eed29198..6db7d94d5c 100644 --- a/core/src/mindustry/logic/LExecutor.java +++ b/core/src/mindustry/logic/LExecutor.java @@ -877,9 +877,9 @@ public class LExecutor{ String strValue = v.objval == null ? "null" : v.objval instanceof String ? (String)v.objval : - v.objval instanceof Content ? "[content]" : - v.objval instanceof Building ? "[building]" : - v.objval instanceof Unit ? "[unit]" : + v.objval instanceof MappableContent ? "[content] " + ((MappableContent)v.objval).name : + v.objval instanceof Building ? "[building] " + ((Building)v.objval).block.name : + v.objval instanceof Unit ? "[unit] " + ((Unit)v.objval).type.name : "[object]"; exec.textBuffer.append(strValue); From 364a2b43c21894e4a6d41759e185d719e6868c2e Mon Sep 17 00:00:00 2001 From: DeltaNedas <39013340+DeltaNedas@users.noreply.github.com> Date: Sat, 24 Oct 2020 17:04:58 +0000 Subject: [PATCH 2/4] add Content fallback --- core/src/mindustry/logic/LExecutor.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/mindustry/logic/LExecutor.java b/core/src/mindustry/logic/LExecutor.java index 6db7d94d5c..449330fcd5 100644 --- a/core/src/mindustry/logic/LExecutor.java +++ b/core/src/mindustry/logic/LExecutor.java @@ -878,6 +878,7 @@ public class LExecutor{ v.objval == null ? "null" : v.objval instanceof String ? (String)v.objval : v.objval instanceof MappableContent ? "[content] " + ((MappableContent)v.objval).name : + v.objval instanceof Content ? "[content]" : v.objval instanceof Building ? "[building] " + ((Building)v.objval).block.name : v.objval instanceof Unit ? "[unit] " + ((Unit)v.objval).type.name : "[object]"; From 801ff1701e891eb3657aec8e8710e33f8c3677ba Mon Sep 17 00:00:00 2001 From: DeltaNedas <39013340+DeltaNedas@users.noreply.github.com> Date: Sat, 24 Oct 2020 17:19:50 +0000 Subject: [PATCH 3/4] silly --- core/src/mindustry/logic/LExecutor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/logic/LExecutor.java b/core/src/mindustry/logic/LExecutor.java index 449330fcd5..ed93b7aeaa 100644 --- a/core/src/mindustry/logic/LExecutor.java +++ b/core/src/mindustry/logic/LExecutor.java @@ -877,10 +877,10 @@ public class LExecutor{ String strValue = v.objval == null ? "null" : v.objval instanceof String ? (String)v.objval : - v.objval instanceof MappableContent ? "[content] " + ((MappableContent)v.objval).name : + v.objval instanceof MappableContent ? ((MappableContent)v.objval).name : v.objval instanceof Content ? "[content]" : - v.objval instanceof Building ? "[building] " + ((Building)v.objval).block.name : - v.objval instanceof Unit ? "[unit] " + ((Unit)v.objval).type.name : + v.objval instanceof Building ? ((Building)v.objval).block.name : + v.objval instanceof Unit ? ((Unit)v.objval).type.name : "[object]"; exec.textBuffer.append(strValue); From 3b2669fa216044d25ad93e4b9253da3f2c843b64 Mon Sep 17 00:00:00 2001 From: DeltaNedas <39013340+DeltaNedas@users.noreply.github.com> Date: Sat, 24 Oct 2020 17:23:54 +0000 Subject: [PATCH 4/4] pattern variables? --- core/src/mindustry/logic/LExecutor.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/logic/LExecutor.java b/core/src/mindustry/logic/LExecutor.java index ed93b7aeaa..d287e9e482 100644 --- a/core/src/mindustry/logic/LExecutor.java +++ b/core/src/mindustry/logic/LExecutor.java @@ -876,11 +876,11 @@ public class LExecutor{ if(v.isobj && value != 0){ String strValue = v.objval == null ? "null" : - v.objval instanceof String ? (String)v.objval : - v.objval instanceof MappableContent ? ((MappableContent)v.objval).name : + v.objval instanceof String s ? s : + v.objval instanceof MappableContent content ? content.name : v.objval instanceof Content ? "[content]" : - v.objval instanceof Building ? ((Building)v.objval).block.name : - v.objval instanceof Unit ? ((Unit)v.objval).type.name : + v.objval instanceof Building build ? build.block.name : + v.objval instanceof Unit unit ? unit.type.name : "[object]"; exec.textBuffer.append(strValue);