water-bound structures can now be placed only in water

This commit is contained in:
Chris Forbes
2009-10-22 23:24:55 +13:00
parent 45139015c5
commit b73e5a62bb
2 changed files with 8 additions and 3 deletions

View File

@@ -35,8 +35,10 @@ namespace OpenRa.Game
if (!hasOverlay)
return;
foreach( var t in Footprint.Tiles( Rules.UnitInfo[ name ], position ) )
spriteRenderer.DrawSprite( Game.IsCellBuildable( t, UnitMovementType.Wheel )
var bi = (UnitInfo.BuildingInfo)Rules.UnitInfo[name];
foreach( var t in Footprint.Tiles( bi, position ) )
spriteRenderer.DrawSprite( Game.IsCellBuildable( t, bi.WaterBound
? UnitMovementType.Float : UnitMovementType.Wheel )
? buildOk : buildBlocked, Game.CellSize * t, 0 );
spriteRenderer.Flush();