can build again
This commit is contained in:
@@ -46,22 +46,10 @@ namespace OpenRa.Game
|
||||
public void DrawBuildingGrid( UnitInfo.BuildingInfo bi )
|
||||
{
|
||||
var position = Game.controller.MousePosition.ToInt2();
|
||||
|
||||
var maxDistance = bi.Adjacent + 2; /* real-ra is weird. this is 1 GAP. */
|
||||
|
||||
//if( ShowBuildDebug )
|
||||
// for( var j = 0 ; j < 128 ; j++ )
|
||||
// for( var i = 0 ; i < 128 ; i++ )
|
||||
// if( Game.GetDistanceToBase( new int2( i, j ), Game.LocalPlayer ) < maxDistance )
|
||||
// if( Game.IsCellBuildable( new int2( i, j ), bi.WaterBound ? UnitMovementType.Float : UnitMovementType.Wheel ) )
|
||||
// if( !Game.map.ContainsResource( new int2( i, j ) ) )
|
||||
// spriteRenderer.DrawSprite( unitDebug, Game.CellSize * new float2( i, j ), 0 );
|
||||
|
||||
var tooFarFromBase = !Footprint.Tiles( bi, position ).Any(
|
||||
t => Game.GetDistanceToBase( t, Game.LocalPlayer ) < maxDistance );
|
||||
|
||||
var isCloseEnough = Game.IsCloseEnoughToBase(Game.LocalPlayer, bi, position);
|
||||
|
||||
foreach( var t in Footprint.Tiles( bi, position ) )
|
||||
spriteRenderer.DrawSprite( ( !tooFarFromBase && Game.IsCellBuildable( t, bi.WaterBound
|
||||
spriteRenderer.DrawSprite( ( isCloseEnough && Game.IsCellBuildable( t, bi.WaterBound
|
||||
? UnitMovementType.Float : UnitMovementType.Wheel ) && !Game.map.ContainsResource( t ) )
|
||||
? buildOk : buildBlocked, Game.CellSize * t, 0 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user