CellIsEvaluating perf optimization
If an actor has Mobile, it implements IOccupySpace so we can use OccupiesSpace to save a trait look-up.
This commit is contained in:
@@ -341,7 +341,7 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
{
|
{
|
||||||
foreach (var actor in self.World.ActorMap.GetActorsAt(cell))
|
foreach (var actor in self.World.ActorMap.GetActorsAt(cell))
|
||||||
{
|
{
|
||||||
var move = actor.TraitOrDefault<Mobile>();
|
var move = actor.OccupiesSpace as Mobile;
|
||||||
if (move == null || !move.IsTraitEnabled() || !move.IsLeaving())
|
if (move == null || !move.IsTraitEnabled() || !move.IsLeaving())
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user