From dded736c8fb1ef316167aaf5e800b93688599230 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 17 Apr 2022 21:05:50 -0400 Subject: [PATCH] Flag set instruction fix --- core/src/mindustry/game/MapObjectives.java | 6 +++--- core/src/mindustry/logic/LExecutor.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/game/MapObjectives.java b/core/src/mindustry/game/MapObjectives.java index ea14723678..3506a5f228 100644 --- a/core/src/mindustry/game/MapObjectives.java +++ b/core/src/mindustry/game/MapObjectives.java @@ -18,7 +18,7 @@ public class MapObjectives{ public static Prov[] allObjectiveTypes = new Prov[]{ ResearchObjective::new, BuildCountObjective::new, UnitCountObjective::new, ItemObjective::new, CommandModeObjective::new, CoreItemObjective::new, DestroyCoreObjective::new, DestroyUnitsObjective::new, - TimerObjective::new + TimerObjective::new, FlagObjective::new }; public static Prov[] allMarkerTypes = new Prov[]{ @@ -224,7 +224,7 @@ public class MapObjectives{ /** Wait until a logic flag is set. */ public static class FlagObjective extends MapObjective{ - public String flag = "flag", text = "Wait for flag"; + public String flag = "flag", text; public FlagObjective(String flag, String text){ this.flag = flag; @@ -236,7 +236,7 @@ public class MapObjectives{ @Override public String text(){ - return text; + return text != null && text.startsWith("@") ? Core.bundle.get(text.substring(1)) : text; } @Override diff --git a/core/src/mindustry/logic/LExecutor.java b/core/src/mindustry/logic/LExecutor.java index eb78121f0a..e408a4a86e 100644 --- a/core/src/mindustry/logic/LExecutor.java +++ b/core/src/mindustry/logic/LExecutor.java @@ -1533,7 +1533,7 @@ public class LExecutor{ @Override public void run(LExecutor exec){ if(exec.obj(flag) instanceof String str){ - if(exec.bool(value)){ + if(!exec.bool(value)){ state.rules.objectiveFlags.remove(str); }else{ state.rules.objectiveFlags.add(str);