Fixed objective flags not syncing
This commit is contained in:
@@ -355,6 +355,12 @@ public class NetClient implements ApplicationListener{
|
|||||||
state.rules.objectives = executor;
|
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)
|
@Remote(variants = Variant.both)
|
||||||
public static void worldDataBegin(){
|
public static void worldDataBegin(){
|
||||||
Groups.clear();
|
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. */
|
/** Called once after {@link #update()} returns true, before this objective is removed. */
|
||||||
public void done(){
|
public void done(){
|
||||||
changed();
|
changed();
|
||||||
state.rules.objectiveFlags.removeAll(flagsRemoved);
|
Call.objectiveCompleted(flagsRemoved, flagsAdded);
|
||||||
state.rules.objectiveFlags.addAll(flagsAdded);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Notifies the executor that map rules should be synced. */
|
/** 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(){
|
public final boolean dependencyFinished(){
|
||||||
if(depFinished) return true;
|
if(depFinished) return true;
|
||||||
|
|
||||||
boolean f = true;
|
|
||||||
for(var parent : parents){
|
for(var parent : parents){
|
||||||
if(!parent.isCompleted()) return false;
|
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). */
|
/** @return True if this objective is done (practically, has been removed from the executor). */
|
||||||
|
|||||||
Reference in New Issue
Block a user