From e07f4c926ea0095c9881410f7c752a4cf9b716ea Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 19 Jan 2010 13:05:20 +1300 Subject: [PATCH] almost. got a problem with missing tiles, though --- OpenRa.Game/Traits/Bridge.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OpenRa.Game/Traits/Bridge.cs b/OpenRa.Game/Traits/Bridge.cs index a3d7af158b..3e4e6abbe1 100644 --- a/OpenRa.Game/Traits/Bridge.cs +++ b/OpenRa.Game/Traits/Bridge.cs @@ -15,7 +15,7 @@ namespace OpenRa.Traits public object Create(Actor self) { return new Bridge(self); } } - class Bridge : IRender, ICustomTerrain + class Bridge : IRender, ICustomTerrain, INotifyDamage { Dictionary Tiles; List> TileSprites = new List>(); @@ -76,5 +76,12 @@ namespace OpenRa.Traits return TerrainCosts.Cost(umt, Templates[state].TerrainType[Tiles[p]]); } + + public void Damaged(Actor self, AttackInfo e) + { + // todo: long bridges have d/e/f states too. + if (e.DamageStateChanged) + state = (int)e.DamageState; + } } }