Flag set instruction fix

This commit is contained in:
Anuken 2022-04-17 21:05:50 -04:00
parent 68e6b7ff3e
commit dded736c8f
2 changed files with 4 additions and 4 deletions

View File

@ -18,7 +18,7 @@ public class MapObjectives{
public static Prov<MapObjective>[] 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<ObjectiveMarker>[] 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

View File

@ -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);