From 130ea06ce8aa9916d94a7dd42d166e430976d956 Mon Sep 17 00:00:00 2001 From: phosit Date: Sat, 20 Sep 2025 16:35:48 +0200 Subject: [PATCH] Don't add queues when deserializing AttackPlans When deserializing the queues are already there. It was an error to try to add a queue since sometimes there must not be a queue. --- .../mods/public/simulation/ai/petra/attackPlan.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/binaries/data/mods/public/simulation/ai/petra/attackPlan.js b/binaries/data/mods/public/simulation/ai/petra/attackPlan.js index 663b95cf20..9744135456 100644 --- a/binaries/data/mods/public/simulation/ai/petra/attackPlan.js +++ b/binaries/data/mods/public/simulation/ai/petra/attackPlan.js @@ -219,10 +219,13 @@ export function AttackPlan(gameState, config, uniqueID, type = AttackPlan.TYPE_D this.unitStat[cat].minSize = Math.ceil(this.Config.popScaling * this.unitStat[cat].minSize); } - // TODO: there should probably be one queue per type of training building - gameState.ai.queueManager.addQueue("plan_" + this.name, priority); - gameState.ai.queueManager.addQueue("plan_" + this.name +"_champ", priority+1); - gameState.ai.queueManager.addQueue("plan_" + this.name +"_siege", priority); + if (!deserialized) + { + // TODO: there should probably be one queue per type of training building + gameState.ai.queueManager.addQueue("plan_" + this.name, priority); + gameState.ai.queueManager.addQueue("plan_" + this.name +"_champ", priority+1); + gameState.ai.queueManager.addQueue("plan_" + this.name +"_siege", priority); + } // each array is [ratio, [associated classes], associated EntityColl, associated unitStat, name ] this.buildOrders = [];