Speed up checks for IOccupySpace trait.

Eagerly load the trait (if it exists) in Actor, and use this reference to avoid having to perform self.Info.HasTraitInfo<IOccupySpaceInfo>() checks.
This commit is contained in:
RoosterDragon
2015-10-14 20:36:32 +01:00
parent 410f121a1e
commit 262ab408b5
5 changed files with 13 additions and 18 deletions

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common
if (self.IsDead)
return false;
if (!self.Info.HasTraitInfo<IOccupySpaceInfo>())
if (self.OccupiesSpace == null)
return false;
if (!self.IsInWorld)