ActorMap, avoid IPositionable trait lookup.
This commit is contained in:
committed by
Matthias Mailänder
parent
d72b1ffd49
commit
7c0f6ead3a
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user