Skip to content

Commit

Permalink
Merge pull request #12924 from reaperrr/fix-tunnel-atk
Browse files Browse the repository at this point in the history
Prevent units in tunnels/underground from attacking
  • Loading branch information
atlimit8 committed Apr 29, 2017
2 parents 60bc114 + 1fae993 commit 4917c6e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions OpenRA.Mods.Common/Traits/Attack/AttackBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ protected virtual bool CanAttack(Actor self, Target target)
if (!HasAnyValidWeapons(target))
return false;

var mobile = self.TraitOrDefault<Mobile>();
if (mobile != null && !mobile.CanInteractWithGroundLayer(self))
return false;

// Building is under construction or is being sold
if (building.Value != null && !building.Value.BuildComplete)
return false;
Expand Down

0 comments on commit 4917c6e

Please sign in to comment.