run target tracking for all players- allies skipped tracking entirely. target can be a moving entity (siege tower, enemy unit), allies need the same update logic.

This commit is contained in:
mehmed-faheim-arslan 2026-04-11 14:39:22 +01:00 committed by mehmed-faheim-arslan
parent a86f850c92
commit d40fb8bb2a

View file

@ -37,14 +37,7 @@ RallyPoint.prototype.GetPositions = function(player = this.GetOwner())
if (!playerEntry)
return [];
// for allied players, return positions directly without moving target tracking.
if (player !== this.GetOwner())
return [...playerEntry.pos];
// (for owner only) update positions for moving target entities.
const cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
const cmpOwnership = Engine.QueryInterface(this.entity, IID_Ownership);
// We must not affect the simulation state here, so copy the state
const ret = [];
@ -56,9 +49,9 @@ RallyPoint.prototype.GetPositions = function(player = this.GetOwner())
if (!playerEntry.data[i]?.target || !this.TargetIsAlive(playerEntry.data[i].target))
continue;
// and visible
if (cmpRangeManager && cmpOwnership &&
cmpRangeManager.GetLosVisibility(playerEntry.data[i].target, cmpOwnership.GetOwner()) != "visible")
// and visible to the player who set this rally point
if (cmpRangeManager &&
cmpRangeManager.GetLosVisibility(playerEntry.data[i].target, player) != "visible")
continue;
// Get the actual position of the target entity