Objective marker cleanup & optimization

This commit is contained in:
Anuken
2024-01-14 12:41:20 -05:00
parent 84add050a9
commit 1d894bdacd
9 changed files with 161 additions and 49 deletions

View File

@@ -2033,12 +2033,12 @@ public class LExecutor{
public void run(LExecutor exec){
var cons = MapObjectives.markerNameToType.get(type);
if(cons != null && state.markers.size < maxMarkers){
if(cons != null && state.markers.size() < maxMarkers){
int mid = exec.numi(id);
if(exec.bool(replace) || !state.markers.containsKey(mid)){
if(exec.bool(replace) || !state.markers.has(mid)){
var marker = cons.get();
marker.control(LMarkerControl.pos, exec.num(x), exec.num(y), 0);
state.markers.put(mid, marker);
state.markers.add(mid, marker);
}
}
}
@@ -2046,7 +2046,7 @@ public class LExecutor{
@Remote(called = Loc.server, variants = Variant.both, unreliable = true)
public static void createMarker(int id, ObjectiveMarker marker){
state.markers.put(id, marker);
state.markers.add(id, marker);
}
@Remote(called = Loc.server, variants = Variant.both, unreliable = true)