ActorMap, avoid IPositionable trait lookup.

This commit is contained in:
Vapre
2023-05-27 23:26:20 +02:00
committed by Matthias Mailänder
parent d72b1ffd49
commit 7c0f6ead3a
5 changed files with 7 additions and 9 deletions

View File

@@ -355,8 +355,8 @@ namespace OpenRA.Mods.Common.Traits
if (checkTransient)
return true;
var pos = i.Actor.TraitOrDefault<IPositionable>();
if (pos == null || !pos.IsLeavingCell(a, i.SubCell))
// PERF: Avoid trait lookup
if (i.Actor.OccupiesSpace is not IPositionable pos || !pos.IsLeavingCell(a, i.SubCell))
return true;
}
}