mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
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:
parent
a86f850c92
commit
d40fb8bb2a
1 changed files with 3 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue