diff --git a/OpenRa.Game/Actor.cs b/OpenRa.Game/Actor.cs index 759a4ad391..5fbdf6dcd2 100755 --- a/OpenRa.Game/Actor.cs +++ b/OpenRa.Game/Actor.cs @@ -83,7 +83,10 @@ namespace OpenRa.Game if (!Rules.Map.IsInMap(xy.X, xy.Y)) return null; - var underCursor = Game.UnitInfluence.GetUnitAt( xy ) ?? Game.BuildingInfluence.GetBuildingAt( xy ); + var underCursor = Game.UnitInfluence.GetUnitAt( xy ) + ?? Game.BuildingInfluence.GetBuildingAt( xy ); + if (underCursor != null && !underCursor.unitInfo.Selectable) + underCursor = null; return traits.WithInterface() .Select( x => x.IssueOrder( this, xy, lmb, underCursor ) ) diff --git a/OpenRa.Game/Game.cs b/OpenRa.Game/Game.cs index 8041feb2c7..3d884a53a8 100644 --- a/OpenRa.Game/Game.cs +++ b/OpenRa.Game/Game.cs @@ -276,6 +276,7 @@ namespace OpenRa.Game public static IEnumerable SelectActorsInBox(float2 a, float2 b) { return FindUnits(a, b) + .Where( x => x.unitInfo.Selectable ) .GroupBy(x => (x.Owner == LocalPlayer) ? x.unitInfo.SelectionPriority : 0) .OrderByDescending(g => g.Key) .Select( g => g.AsEnumerable() ) diff --git a/OpenRa.Game/GameRules/UnitInfo.cs b/OpenRa.Game/GameRules/UnitInfo.cs index 2d1ef73114..a4e6d05cd5 100755 --- a/OpenRa.Game/GameRules/UnitInfo.cs +++ b/OpenRa.Game/GameRules/UnitInfo.cs @@ -54,6 +54,7 @@ namespace OpenRa.Game.GameRules public readonly bool MuzzleFlash = false; public readonly int SelectionPriority = 10; public readonly int InitialFacing = 128; + public readonly bool Selectable = true; public UnitInfo(string name) { Name = name; } } diff --git a/trees.ini b/trees.ini index 0fee0faf5c..40a1f283aa 100644 --- a/trees.ini +++ b/trees.ini @@ -26,165 +26,165 @@ Description=Tree Traits=Building, RenderBuilding Footprint=x_ x_ Dimensions=2,2 -SelectionPriority=-1 Name=T01 +Selectable=no [T02] Description=Tree Traits=Building, RenderBuilding Footprint=x_ x_ Dimensions=2,2 -SelectionPriority=-1 Name=T02 +Selectable=no [T03] Description=Tree Traits=Building, RenderBuilding Footprint=x_ x_ Dimensions=2,2 -SelectionPriority=-1 Name=T03 +Selectable=no [T05] Description=Tree Traits=Building, RenderBuilding Footprint=x_ x_ Dimensions=2,2 -SelectionPriority=-1 Name=T05 +Selectable=no [T06] Description=Tree Traits=Building, RenderBuilding Footprint=x_ x_ Dimensions=2,2 -SelectionPriority=-1 Name=T06 +Selectable=no [T07] Description=Tree Traits=Building, RenderBuilding Footprint=x_ x_ Dimensions=2,2 -SelectionPriority=-1 Name=T07 +Selectable=no [T08] Description=Tree Traits=Building, RenderBuilding Footprint=x_ Dimensions=2,1 -SelectionPriority=-1 Name=T08 +Selectable=no [T10] Description=Tree Traits=Building, RenderBuilding Footprint=xx xx Dimensions=2,2 -SelectionPriority=-1 Name=T10 +Selectable=no [T11] Description=Tree Traits=Building, RenderBuilding Footprint=xx xx Dimensions=2,2 -SelectionPriority=-1 Name=T11 +Selectable=no [T12] Description=Tree Traits=Building, RenderBuilding Footprint=xx xx Dimensions=2,2 -SelectionPriority=-1 Name=T12 +Selectable=no [T13] Description=Tree Traits=Building, RenderBuilding Footprint=xx xx Dimensions=2,2 -SelectionPriority=-1 Name=T13 +Selectable=no [T14] Description=Tree Traits=Building, RenderBuilding Footprint=xx xx Dimensions=2,2 -SelectionPriority=-1 Name=T14 +Selectable=no [T15] Description=Tree Traits=Building, RenderBuilding Footprint=xx xx Dimensions=2,2 -SelectionPriority=-1 Name=T15 +Selectable=no [T16] Description=Tree Traits=Building, RenderBuilding Footprint=x_ x_ Dimensions=2,2 -SelectionPriority=-1 Name=T16 +Selectable=no [T17] Description=Tree Traits=Building, RenderBuilding Footprint=x_ x_ Dimensions=2,2 -SelectionPriority=-1 Name=T17 +Selectable=no [TC01] Description=Tree Traits=Building, RenderBuilding Footprint=xx xx Dimensions=2,2 -SelectionPriority=-1 Name=TC01 +Selectable=no [TC02] Description=Tree Traits=Building, RenderBuilding Footprint=xx xx Dimensions=2,2 -SelectionPriority=-1 Name=TC02 +Selectable=no [TC03] Description=Tree Traits=Building, RenderBuilding Footprint=xx xx Dimensions=2,2 -SelectionPriority=-1 Name=TC03 +Selectable=no [TC04] Description=Tree Traits=Building, RenderBuilding Footprint=xxx xxx xxx Dimensions=3,3 -SelectionPriority=-1 Name=TC04 +Selectable=no [TC05] Description=Tree Traits=Building, RenderBuilding Footprint=xxx xxx xxx Dimensions=3,3 -SelectionPriority=-1 Name=TC05 +Selectable=no [MINE] Description=Ore Pit Traits=Building, RenderBuilding Footprint=x Dimensions=1,1 -SelectionPriority=-1 -Name=MINE \ No newline at end of file +Name=MINE +Selectable=no \ No newline at end of file