Convert Combat.DoExplosion to world coords.

This commit is contained in:
Paul Chote
2013-07-06 20:26:09 +12:00
parent 0fdffd7b6a
commit 7883b1bd7f
7 changed files with 13 additions and 15 deletions

View File

@@ -139,22 +139,24 @@ namespace OpenRA.Mods.RA
}
}
public static void DoExplosion(Actor attacker, string weapontype, PPos pos, int altitude)
public static void DoExplosion(Actor attacker, string weapontype, WPos pos)
{
var pxPos = PPos.FromWPos(pos);
var altitude = pos.Z * Game.CellSize / 1024;
var args = new ProjectileArgs
{
src = pos,
dest = pos,
src = pxPos,
dest = pxPos,
srcAltitude = altitude,
destAltitude = altitude,
firedBy = attacker,
target = Target.FromPos(pos),
target = Target.FromPos(pxPos),
weapon = Rules.Weapons[weapontype.ToLowerInvariant()],
facing = 0
};
if (args.weapon.Report != null && args.weapon.Report.Any())
Sound.Play(args.weapon.Report.Random(attacker.World.SharedRandom), pos);
Sound.Play(args.weapon.Report.Random(attacker.World.SharedRandom), pxPos);
DoImpacts(args);
}