mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-02 04:13:44 +07:00
Fixed objective flags not syncing
This commit is contained in:
parent
2b9ee88cc2
commit
a00b3a4670
@ -355,6 +355,12 @@ public class NetClient implements ApplicationListener{
|
||||
state.rules.objectives = executor;
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
public static void objectiveCompleted(String[] flagsRemoved, String[] flagsAdded){
|
||||
state.rules.objectiveFlags.removeAll(flagsRemoved);
|
||||
state.rules.objectiveFlags.addAll(flagsAdded);
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.both)
|
||||
public static void worldDataBegin(){
|
||||
Groups.clear();
|
||||
|
@ -193,8 +193,7 @@ public class MapObjectives implements Iterable<MapObjective>, Eachable<MapObject
|
||||
/** Called once after {@link #update()} returns true, before this objective is removed. */
|
||||
public void done(){
|
||||
changed();
|
||||
state.rules.objectiveFlags.removeAll(flagsRemoved);
|
||||
state.rules.objectiveFlags.addAll(flagsAdded);
|
||||
Call.objectiveCompleted(flagsRemoved, flagsAdded);
|
||||
}
|
||||
|
||||
/** Notifies the executor that map rules should be synced. */
|
||||
@ -206,12 +205,11 @@ public class MapObjectives implements Iterable<MapObjective>, Eachable<MapObject
|
||||
public final boolean dependencyFinished(){
|
||||
if(depFinished) return true;
|
||||
|
||||
boolean f = true;
|
||||
for(var parent : parents){
|
||||
if(!parent.isCompleted()) return false;
|
||||
}
|
||||
|
||||
return f && (depFinished = true);
|
||||
return depFinished = true;
|
||||
}
|
||||
|
||||
/** @return True if this objective is done (practically, has been removed from the executor). */
|
||||
|
Loading…
Reference in New Issue
Block a user