Skip to content

Commit

Permalink
undo ProjectileArgs stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisforbes committed Jul 22, 2010
1 parent 6d527c3 commit 31d5d18
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion OpenRA.Mods.Aftermath/DemoTruck.cs
Expand Up @@ -39,7 +39,7 @@ public void Detonate(Actor self, Actor detonatedBy)

self.World.AddFrameEndTask( w =>
{
Combat.DoExplosion(self, info.PrimaryWeapon, Target.FromActor(self), altitude);
Combat.DoExplosion(self, info.PrimaryWeapon, self.CenterLocation, altitude);
var report = self.GetPrimaryWeapon().Report;
if (report != null)
Sound.Play(report + ".aud", self.CenterLocation);
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Cnc/Effects/IonCannon.cs
Expand Up @@ -42,7 +42,7 @@ public IEnumerable<Renderable> Render()
void Finish( World world )
{
world.AddFrameEndTask(w => w.Remove(this));
Combat.DoExplosion(firedBy, "IonCannon", target, 0);
Combat.DoExplosion(firedBy, "IonCannon", target.CenterLocation, 0);
}
}
}
8 changes: 4 additions & 4 deletions OpenRA.Mods.RA/Combat.cs
Expand Up @@ -113,16 +113,16 @@ public static void DoImpacts(ProjectileArgs args)
}
}

public static void DoExplosion(Actor attacker, string weapontype, Target _target, int altitude)
public static void DoExplosion(Actor attacker, string weapontype, float2 pos, int altitude)
{
var args = new ProjectileArgs
{
src = Util.CellContaining(_target.CenterLocation),
dest = Util.CellContaining(_target.CenterLocation),
src = pos.ToInt2(),
dest = pos.ToInt2(),
srcAltitude = altitude,
destAltitude = altitude,
firedBy = attacker,
target = _target,
target = Target.FromPos(pos),
weapon = Rules.Weapons[ weapontype.ToLowerInvariant() ],
facing = 0
};
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.RA/Crates/ExplodeCrateAction.cs
Expand Up @@ -27,7 +27,7 @@ public ExplodeCrateAction(Actor self, ExplodeCrateActionInfo info)

public override void Activate(Actor collector)
{
Combat.DoExplosion(self, (info as ExplodeCrateActionInfo).Weapon, Target.FromActor(collector), 0);
Combat.DoExplosion(self, (info as ExplodeCrateActionInfo).Weapon, collector.CenterLocation, 0);
base.Activate(collector);
}
}
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.RA/Effects/NukeLaunch.cs
Expand Up @@ -76,7 +76,7 @@ public void Tick(World world)
void Explode(World world)
{
world.AddFrameEndTask(w => w.Remove(this));
Combat.DoExplosion(silo.Owner.PlayerActor, weapon, Target.FromPos(pos), 0);
Combat.DoExplosion(silo.Owner.PlayerActor, weapon, pos, 0);
world.WorldActor.traits.Get<ScreenShaker>().AddEffect(20, pos, 5);
}

Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.RA/Explodes.cs
Expand Up @@ -32,7 +32,7 @@ public void Damaged(Actor self, AttackInfo e)
{
var unit = self.traits.GetOrDefault<Unit>();
var altitude = unit != null ? unit.Altitude : 0;
Combat.DoExplosion(e.Attacker, weapon, Target.FromActor(self), altitude);
Combat.DoExplosion(e.Attacker, weapon, self.CenterLocation, altitude);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.RA/Mine.cs
Expand Up @@ -45,7 +45,7 @@ public void OnCrush(Actor crusher)
return;

var info = self.Info.Traits.Get<MineInfo>();
Combat.DoExplosion(self, info.Weapon, Target.FromActor(crusher), 0);
Combat.DoExplosion(self, info.Weapon, crusher.CenterLocation, 0);
self.QueueActivity(new RemoveSelf());
}

Expand Down

0 comments on commit 31d5d18

Please sign in to comment.