Remove obsolete LocomotorInfo caching.
This commit is contained in:
committed by
Matthias Mailänder
parent
49e7a33db0
commit
5a7dc385a3
@@ -29,11 +29,11 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
|
||||
// (Way better than finding a nearest target which is likely to be on Ground)
|
||||
// You might be tempted to move these lookups into Activate() but that causes null reference exception.
|
||||
var domainIndex = first.World.WorldActor.Trait<DomainIndex>();
|
||||
var locomotorInfo = first.Info.TraitInfo<MobileInfo>().LocomotorInfo;
|
||||
var locomotor = first.Trait<Mobile>().Locomotor;
|
||||
|
||||
var navalProductions = owner.World.ActorsHavingTrait<Building>().Where(a
|
||||
=> owner.SquadManager.Info.NavalProductionTypes.Contains(a.Info.Name)
|
||||
&& domainIndex.IsPassable(first.Location, a.Location, locomotorInfo)
|
||||
&& domainIndex.IsPassable(first.Location, a.Location, locomotor)
|
||||
&& a.AppearsHostileTo(first));
|
||||
|
||||
if (navalProductions.Any())
|
||||
|
||||
Reference in New Issue
Block a user