From 08959e24d569be76704ed73f63474b260ee07307 Mon Sep 17 00:00:00 2001 From: Slotterleet <62336673+Slotterleet@users.noreply.github.com> Date: Sat, 27 Apr 2024 18:49:41 +0300 Subject: [PATCH] Try a different approach on resolving the issue --- src/fos/core/FOSMod.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/fos/core/FOSMod.java b/src/fos/core/FOSMod.java index 1d17424..bad1b10 100644 --- a/src/fos/core/FOSMod.java +++ b/src/fos/core/FOSMod.java @@ -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; @@ -154,14 +153,11 @@ public void init() { Reflect.>>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;