Skip to content

Commit

Permalink
Merge pull request #7522 from delftswa2014/bugfix/sellicon
Browse files Browse the repository at this point in the history
Closes #7508
  • Loading branch information
Mailaender committed Mar 8, 2015
2 parents 78e74eb + 97ca96f commit 762c0e1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions OpenRA.Mods.Common/Orders/GlobalButtonOrderGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,14 @@ IEnumerable<Order> OrderInner(World world, MouseInput mi)
.FirstOrDefault(a => a.Owner == world.LocalPlayer && a.TraitsImplementing<T>()
.Any(Exts.IsTraitEnabled));

if (underCursor != null)
yield return new Order(order, underCursor, false);
if (underCursor == null)
yield break;

var building = underCursor.TraitOrDefault<Building>();
if (building != null && building.Locked)
yield break;

yield return new Order(order, underCursor, false);
}
}

Expand Down

0 comments on commit 762c0e1

Please sign in to comment.