water-bound structures can now be placed only in water
This commit is contained in:
@@ -20,7 +20,10 @@ namespace OpenRa.Game
|
||||
public IEnumerable<Order> Order(int2 xy)
|
||||
{
|
||||
// todo: check that space is free
|
||||
if (Footprint.Tiles(Rules.UnitInfo[Name], xy).Any(t => !Game.IsCellBuildable(t, UnitMovementType.Wheel)))
|
||||
var bi = (UnitInfo.BuildingInfo)Rules.UnitInfo[Name];
|
||||
if (Footprint.Tiles(bi, xy).Any(
|
||||
t => !Game.IsCellBuildable(t,
|
||||
bi.WaterBound ? UnitMovementType.Float : UnitMovementType.Wheel)))
|
||||
yield break;
|
||||
|
||||
yield return new PlaceBuildingOrder(this, xy);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user