From 3bf2e18e855eb8c59aad4d0eff29931222089ef6 Mon Sep 17 00:00:00 2001 From: DeltaNedas Date: Mon, 27 Jul 2020 03:55:59 +0100 Subject: [PATCH 1/3] add 'use strict' to mod scripts --- core/src/mindustry/mod/Scripts.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/mod/Scripts.java b/core/src/mindustry/mod/Scripts.java index a0b106e574..1b3feb13f1 100644 --- a/core/src/mindustry/mod/Scripts.java +++ b/core/src/mindustry/mod/Scripts.java @@ -93,7 +93,7 @@ public class Scripts implements Disposable{ context.evaluateString(scope, "modName = \"" + currentMod.name + "\"\nscriptName = \"" + file + "\"", "initscript.js", 1, null); } context.evaluateString(scope, - wrap ? "(function(){\n" + script + "\n})();" : script, + wrap ? "(function(){'use strict'\n" + script + "\n})();" : script, file, 0, null); return true; }catch(Throwable t){ From c21a0a25162e69d29c32e43aa524ce3e677ff1a5 Mon Sep 17 00:00:00 2001 From: Dexapnow <42710595+Dexapnow@users.noreply.github.com> Date: Mon, 27 Jul 2020 20:27:27 +0200 Subject: [PATCH 2/3] Remove "sortersnek" There is many reasons behind it, but most important (that let to removing other "sneks") is infinite throughput/teleporter like mechanic. I know that most of players like it and they will never change their mind, so this might be better solution. --- core/src/mindustry/world/blocks/distribution/Sorter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/world/blocks/distribution/Sorter.java b/core/src/mindustry/world/blocks/distribution/Sorter.java index 8fa77bb230..32b13be399 100644 --- a/core/src/mindustry/world/blocks/distribution/Sorter.java +++ b/core/src/mindustry/world/blocks/distribution/Sorter.java @@ -88,7 +88,7 @@ public class Sorter extends Block{ boolean isSame(Building other){ //uncomment code below to prevent sorter/gate chaining - return other != null && (other.block() instanceof Sorter/* || other.block() instanceof OverflowGate */); + return other != null && (other.block() instanceof Sorter || other.block() instanceof OverflowGate); } Building getTileTarget(Item item, Building source, boolean flip){ From 6c6640f6c612270dc645d9177f16f37d1cf2571b Mon Sep 17 00:00:00 2001 From: DeltaNedas <39013340+DeltaNedas@users.noreply.github.com> Date: Tue, 28 Jul 2020 11:57:02 +0000 Subject: [PATCH 3/3] semicolon --- core/src/mindustry/mod/Scripts.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/mod/Scripts.java b/core/src/mindustry/mod/Scripts.java index 1b3feb13f1..05aa9141da 100644 --- a/core/src/mindustry/mod/Scripts.java +++ b/core/src/mindustry/mod/Scripts.java @@ -93,7 +93,7 @@ public class Scripts implements Disposable{ context.evaluateString(scope, "modName = \"" + currentMod.name + "\"\nscriptName = \"" + file + "\"", "initscript.js", 1, null); } context.evaluateString(scope, - wrap ? "(function(){'use strict'\n" + script + "\n})();" : script, + wrap ? "(function(){'use strict';\n" + script + "\n})();" : script, file, 0, null); return true; }catch(Throwable t){