Prevent attacking while in tunnel/underground
This commit is contained in:
@@ -80,6 +80,10 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (!HasAnyValidWeapons(target))
|
if (!HasAnyValidWeapons(target))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
var mobile = self.TraitOrDefault<Mobile>();
|
||||||
|
if (mobile != null && !mobile.CanInteractWithGroundLayer(self))
|
||||||
|
return false;
|
||||||
|
|
||||||
// Building is under construction or is being sold
|
// Building is under construction or is being sold
|
||||||
if (building.Value != null && !building.Value.BuildComplete)
|
if (building.Value != null && !building.Value.BuildComplete)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user