Closes Anuken/Mindustry-Suggestions/issues/4703
This commit is contained in:
@@ -1883,13 +1883,14 @@ public class LExecutor{
|
||||
public static final int maxMarkers = 20000;
|
||||
|
||||
public String type = "shape";
|
||||
public int id, x, y;
|
||||
public int id, x, y, replace;
|
||||
|
||||
public MakeMarkerI(String type, int id, int x, int y){
|
||||
public MakeMarkerI(String type, int id, int x, int y, int replace){
|
||||
this.type = type;
|
||||
this.id = id;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.replace = replace;
|
||||
}
|
||||
|
||||
public MakeMarkerI(){
|
||||
@@ -1900,9 +1901,12 @@ public class LExecutor{
|
||||
var cons = MapObjectives.markerNameToType.get(type);
|
||||
|
||||
if(cons != null && state.markers.size < maxMarkers){
|
||||
var marker = cons.get();
|
||||
marker.control(LMarkerControl.pos, exec.num(x), exec.num(y), 0);
|
||||
state.markers.put(exec.numi(id), marker);
|
||||
int mid = exec.numi(id);
|
||||
if(exec.bool(replace) || !state.markers.containsKey(mid)){
|
||||
var marker = cons.get();
|
||||
marker.control(LMarkerControl.pos, exec.num(x), exec.num(y), 0);
|
||||
state.markers.put(mid, marker);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1982,7 +1982,7 @@ public class LStatements{
|
||||
|
||||
@RegisterStatement("makemarker")
|
||||
public static class MakeMarkerStatement extends LStatement{
|
||||
public String id = "0", type = "shape", x = "0", y = "0";
|
||||
public String id = "0", type = "shape", x = "0", y = "0", replace = "true";
|
||||
|
||||
@Override
|
||||
public void build(Table table){
|
||||
@@ -2004,6 +2004,10 @@ public class LStatements{
|
||||
fieldst(table, "x", x, v -> x = v);
|
||||
|
||||
fieldst(table, "y", y, v -> y = v);
|
||||
|
||||
row(table);
|
||||
|
||||
fieldst(table, "replace", replace, v -> replace = v);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2013,7 +2017,7 @@ public class LStatements{
|
||||
|
||||
@Override
|
||||
public LInstruction build(LAssembler builder){
|
||||
return new MakeMarkerI(type, builder.var(id), builder.var(x), builder.var(y));
|
||||
return new MakeMarkerI(type, builder.var(id), builder.var(x), builder.var(y), builder.var(replace));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user