Convert Target positions to world coords.

This commit is contained in:
Paul Chote
2013-07-07 10:30:09 +12:00
parent d0bed06765
commit 89fd889cf4
5 changed files with 11 additions and 10 deletions

View File

@@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA.Buildings
continue;
// Range is counted from the center of the actor, not from each cell.
var target = Target.FromPos(bp.Actor.CenterLocation);
var target = Target.FromPos(bp.Actor.CenterPosition);
if (target.IsInRange(center, WRange.FromCells(bp.Trait.Info.Range)))
return bp.Actor;
}

View File

@@ -150,7 +150,7 @@ namespace OpenRA.Mods.RA
srcAltitude = altitude,
destAltitude = altitude,
firedBy = attacker,
target = Target.FromPos(pxPos),
target = Target.FromPos(pos),
weapon = Rules.Weapons[weapontype.ToLowerInvariant()],
facing = 0
};

View File

@@ -125,7 +125,7 @@ namespace OpenRA.Mods.RA.Missions
if (world.FrameNumber == frameInfiltrated + 1500 * 12 && !bridgeTank.IsDead() && bridgeTank.IsInWorld && !bridge.IsDead())
{
bridgeTank.QueueActivity(new Attack(Target.FromPos(bridge.CenterLocation), WRange.FromCells(4)));
bridgeTank.QueueActivity(new Attack(Target.FromPos(bridge.CenterPosition), WRange.FromCells(4)));
attackingBridge = true;
}
if (attackingBridge && bridge.IsDead())

View File

@@ -46,7 +46,7 @@ namespace OpenRA.Mods.RA.Move
public override IEnumerable<Target> GetTargets( Actor self )
{
yield return Target.FromPos(PPos.FromWPos(end));
yield return Target.FromPos(end);
}
// Cannot be cancelled