Correct the ordering on DamageState

This commit is contained in:
Paul Chote
2010-07-30 22:02:19 +12:00
parent 4cf0610fd9
commit 8528c5d3a3
12 changed files with 28 additions and 40 deletions

View File

@@ -61,19 +61,15 @@ namespace OpenRA.Mods.RA.Render
if (!e.DamageStateChanged)
return;
switch( e.DamageState )
if (e.DamageState == DamageState.Dead)
self.World.AddFrameEndTask(w => w.Add(new Explosion(w, self.CenterLocation.ToInt2(), "building", false)));
else if (e.DamageState >= DamageState.Heavy)
{
case DamageState.Medium: case DamageState.Light: case DamageState.Undamaged:
anim.ReplaceAnim("idle");
break;
case DamageState.Heavy: case DamageState.Critical:
anim.ReplaceAnim("damaged-idle");
Sound.Play(self.Info.Traits.Get<BuildingInfo>().DamagedSound, self.CenterLocation);
break;
case DamageState.Dead:
self.World.AddFrameEndTask(w => w.Add(new Explosion(w, self.CenterLocation.ToInt2(), "building", false)));
break;
anim.ReplaceAnim("damaged-idle");
Sound.Play(self.Info.Traits.Get<BuildingInfo>().DamagedSound, self.CenterLocation);
}
else
anim.ReplaceAnim("idle");
}
public void Selling( Actor self )