Flag set instruction fix
This commit is contained in:
@@ -18,7 +18,7 @@ public class MapObjectives{
|
|||||||
public static Prov<MapObjective>[] allObjectiveTypes = new Prov[]{
|
public static Prov<MapObjective>[] allObjectiveTypes = new Prov[]{
|
||||||
ResearchObjective::new, BuildCountObjective::new, UnitCountObjective::new, ItemObjective::new,
|
ResearchObjective::new, BuildCountObjective::new, UnitCountObjective::new, ItemObjective::new,
|
||||||
CommandModeObjective::new, CoreItemObjective::new, DestroyCoreObjective::new, DestroyUnitsObjective::new,
|
CommandModeObjective::new, CoreItemObjective::new, DestroyCoreObjective::new, DestroyUnitsObjective::new,
|
||||||
TimerObjective::new
|
TimerObjective::new, FlagObjective::new
|
||||||
};
|
};
|
||||||
|
|
||||||
public static Prov<ObjectiveMarker>[] allMarkerTypes = new Prov[]{
|
public static Prov<ObjectiveMarker>[] allMarkerTypes = new Prov[]{
|
||||||
@@ -224,7 +224,7 @@ public class MapObjectives{
|
|||||||
|
|
||||||
/** Wait until a logic flag is set. */
|
/** Wait until a logic flag is set. */
|
||||||
public static class FlagObjective extends MapObjective{
|
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){
|
public FlagObjective(String flag, String text){
|
||||||
this.flag = flag;
|
this.flag = flag;
|
||||||
@@ -236,7 +236,7 @@ public class MapObjectives{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String text(){
|
public String text(){
|
||||||
return text;
|
return text != null && text.startsWith("@") ? Core.bundle.get(text.substring(1)) : text;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1533,7 +1533,7 @@ public class LExecutor{
|
|||||||
@Override
|
@Override
|
||||||
public void run(LExecutor exec){
|
public void run(LExecutor exec){
|
||||||
if(exec.obj(flag) instanceof String str){
|
if(exec.obj(flag) instanceof String str){
|
||||||
if(exec.bool(value)){
|
if(!exec.bool(value)){
|
||||||
state.rules.objectiveFlags.remove(str);
|
state.rules.objectiveFlags.remove(str);
|
||||||
}else{
|
}else{
|
||||||
state.rules.objectiveFlags.add(str);
|
state.rules.objectiveFlags.add(str);
|
||||||
|
|||||||
Reference in New Issue
Block a user