Save Mobile trait look-up in AttackBase
This commit is contained in:
@@ -152,7 +152,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (!HasAnyValidWeapons(target))
|
||||
return false;
|
||||
|
||||
var mobile = self.TraitOrDefault<Mobile>();
|
||||
// PERF: Mobile implements IPositionable, so we can use 'as' to save a trait look-up here.
|
||||
var mobile = positionable as Mobile;
|
||||
if (mobile != null && !mobile.CanInteractWithGroundLayer(self))
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user