From d1cf1e2abad423499ae86cd79bb2c63af73d8834 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 17 Apr 2022 18:53:28 -0400 Subject: [PATCH] Avoid caching paths on servers --- core/assets/bundles/bundle.properties | 1 + core/src/mindustry/ai/Pathfinder.java | 3 ++- .../mindustry/ui/dialogs/CustomRulesDialog.java | 16 ++++++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 8dbb01b956..efa2d0465c 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -585,6 +585,7 @@ loadout = Loadout resources = Resources resources.max = Max bannedblocks = Banned Blocks +objectives = Objectives bannedunits = Banned Units addall = Add All launch.from = Launching From: [accent]{0} diff --git a/core/src/mindustry/ai/Pathfinder.java b/core/src/mindustry/ai/Pathfinder.java index 2b81119e12..f841a2f57e 100644 --- a/core/src/mindustry/ai/Pathfinder.java +++ b/core/src/mindustry/ai/Pathfinder.java @@ -95,7 +95,8 @@ public class Pathfinder implements Runnable{ tiles[i] = packTile(tile); } - if(state.rules.waveTeam.needsFlowField()){ + //don't bother setting up paths unless necessary + if(state.rules.waveTeam.needsFlowField() && !net.client()){ preloadPath(getField(state.rules.waveTeam, costGround, fieldCore)); //preload water on naval maps diff --git a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java index ff22c29bcb..9d9712f1a3 100644 --- a/core/src/mindustry/ui/dialogs/CustomRulesDialog.java +++ b/core/src/mindustry/ui/dialogs/CustomRulesDialog.java @@ -164,11 +164,16 @@ public class CustomRulesDialog extends BaseDialog{ i -> true, () -> rules.loadout.clear().add(new ItemStack(Items.copper, 100)), () -> {}, () -> {} - )).left().width(300f); - main.row(); + )).left().width(300f).row(); - main.button("@bannedblocks", () -> showBanned("@bannedblocks", ContentType.block, rules.bannedBlocks, Block::canBeBuilt)).left().width(300f); - main.row(); + main.button("@bannedblocks", () -> showBanned("@bannedblocks", ContentType.block, rules.bannedBlocks, Block::canBeBuilt)).left().width(300f).row(); + + //TODO objectives would be nice + if(experimental && false){ + main.button("@objectives", () -> { + + }).left().width(300f).row(); + } title("@rules.title.unit"); check("@rules.unitammo", b -> rules.unitAmmo = b, () -> rules.unitAmmo); @@ -177,8 +182,7 @@ public class CustomRulesDialog extends BaseDialog{ number("@rules.unitdamagemultiplier", f -> rules.unitDamageMultiplier = f, () -> rules.unitDamageMultiplier); number("@rules.unitbuildspeedmultiplier", f -> rules.unitBuildSpeedMultiplier = f, () -> rules.unitBuildSpeedMultiplier, 0f, 50f); - main.button("@bannedunits", () -> showBanned("@bannedunits", ContentType.unit, rules.bannedUnits, u -> !u.isHidden())).left().width(300f); - main.row(); + main.button("@bannedunits", () -> showBanned("@bannedunits", ContentType.unit, rules.bannedUnits, u -> !u.isHidden())).left().width(300f).row(); title("@rules.title.enemy"); check("@rules.attack", b -> rules.attackMode = b, () -> rules.attackMode);