From 2c44b5301c412400cd9d611da2bbcf265d45df3b Mon Sep 17 00:00:00 2001 From: phosit Date: Wed, 8 Jul 2026 15:52:15 +0200 Subject: [PATCH] Only clone this.targetPos when it's an object When writing 55f2d356ff, I didn't know that `clone` only handles objects. Now there is an extra path for `undefined`. Fixes: #8951 --- binaries/data/mods/public/simulation/ai/petra/attackPlan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binaries/data/mods/public/simulation/ai/petra/attackPlan.js b/binaries/data/mods/public/simulation/ai/petra/attackPlan.js index 98d5284d29..3a2a134d8f 100644 --- a/binaries/data/mods/public/simulation/ai/petra/attackPlan.js +++ b/binaries/data/mods/public/simulation/ai/petra/attackPlan.js @@ -2284,7 +2284,7 @@ AttackPlan.prototype.Serialize = function() "isBlocked": this.isBlocked, "targetPlayer": this.targetPlayer, "target": this.target !== undefined ? this.target.id() : undefined, - "targetPos": clone(this.targetPos), + "targetPos": this.targetPos !== undefined ? clone(this.targetPos) : undefined, "uniqueTargetId": this.uniqueTargetId, "path": this.path, "unitCollUpdateArray": this.unitCollUpdateArray