Skip to content

Commit

Permalink
Try a different approach on resolving the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Slotterleet committed Apr 27, 2024
1 parent c0238f7 commit 08959e2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/fos/core/FOSMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import fos.ui.*;
import fos.ui.menus.*;
import mindustry.ai.Pathfinder;
import mindustry.core.GameState;
import mindustry.game.*;
import mindustry.gen.*;
import mindustry.mod.Mod;
Expand Down Expand Up @@ -154,14 +153,11 @@ public void init() {
Reflect.<Seq<Prov<Pathfinder.Flowfield>>>get(pathfinder, "fieldTypes").add(() -> pt);
Events.on(EventType.WorldLoadEvent.class, e -> {
if (!net.client()) {
FOSVars.fposVector.setZero();
// FIXME: sometimes breaks for unknown reason
Reflect.invoke(pathfinder, "preloadPath", new Object[]{pt}, Pathfinder.Flowfield.class);
}
});
Events.on(EventType.StateChangeEvent.class, e -> {
// reset the flowfield's vector on exit.
if (e.to == GameState.State.menu) FOSVars.fposVector.setZero();
});

//anything after this should not be initialized on dedicated servers.
if (headless) return;
Expand Down

0 comments on commit 08959e2

Please sign in to comment.