Prevent attacking while in tunnel/underground

This commit is contained in:
reaperrr
2017-04-18 20:12:09 +02:00
parent afc1f22c63
commit 1fae993593

View File

@@ -80,6 +80,10 @@ namespace OpenRA.Mods.Common.Traits
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;