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
This commit is contained in:
phosit
2026-07-08 15:52:15 +02:00
parent 99bbc24265
commit 2c44b5301c
@@ -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