Create INotifyDamageStateChanged for nearly everything else that used INotifyDamage.

This commit is contained in:
Paul Chote
2011-04-16 11:48:28 +12:00
parent 8b00e1cfa5
commit 794dcac4d2
10 changed files with 35 additions and 46 deletions

View File

@@ -62,7 +62,7 @@ namespace OpenRA.Mods.RA
}
}
class Bridge: IRenderAsTerrain, INotifyDamage
class Bridge: IRenderAsTerrain, INotifyDamageStateChanged
{
static string cachedTileset;
static Cache<TileReference<ushort,byte>, Sprite> sprites;
@@ -192,14 +192,11 @@ namespace OpenRA.Mods.RA
self.World.Map.CustomTerrain[c.X, c.Y] = GetTerrainType(c);
}
public void Damaged(Actor self, AttackInfo e)
public void DamageStateChanged(Actor self, AttackInfo e)
{
if (e.DamageStateChanged)
{
UpdateState();
if (northNeighbour != null) northNeighbour.UpdateState();
if (southNeighbour != null) southNeighbour.UpdateState();
}
UpdateState();
if (northNeighbour != null) northNeighbour.UpdateState();
if (southNeighbour != null) southNeighbour.UpdateState();
}
}
}