Markers no longer synced

This commit is contained in:
Anuken 2023-09-28 18:25:20 -04:00
parent 6119f3a507
commit d41b6f219b
2 changed files with 6 additions and 9 deletions

View File

@ -153,7 +153,7 @@ public class GlobalVars{
//network
vars.items[varServer].numval = (net.server() || !net.active()) ? 1 : 0;
vars.items[varServer].numval = net.client() ? 1 : 0;
vars.items[varClient].numval = net.client() ? 1 : 0;
}
/** @return a piece of content based on its logic ID. This is not equivalent to content ID. */

View File

@ -1866,13 +1866,12 @@ public class LExecutor{
if(marker == null) return;
if(type == LMarkerControl.text){
Call.updateMarkerText(exec.numi(id), type, (exec.obj(p1) != null ? exec.obj(p1).toString() : "null"));
marker.setText((exec.obj(p1) != null ? exec.obj(p1).toString() : "null"), false);
}else if(type == LMarkerControl.flushText){
Call.updateMarkerText(exec.numi(id), type, exec.textBuffer.toString());
marker.setText(exec.textBuffer.toString(), true);
exec.textBuffer.setLength(0);
}else{
//TODO this aggressively spams packets to everyone
Call.updateMarker(exec.numi(id), type, exec.num(p1), exec.num(p2), exec.num(p3));
marker.control(type, exec.num(p1), exec.num(p2), exec.num(p3));
}
}
}
@ -1899,12 +1898,10 @@ public class LExecutor{
public void run(LExecutor exec){
var cons = MapObjectives.markerNameToType.get(type);
if(cons != null && !net.client() && state.markers.size < maxMarkers){
//TODO max markers...
if(cons != null && state.markers.size < maxMarkers){
var marker = cons.get();
marker.control(LMarkerControl.pos, exec.num(x), exec.num(y), 0);
Call.createMarker(exec.numi(id), marker);
state.markers.put(exec.numi(id), marker);
}
}
}