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