Make orientation caching in HitShape readonly

HitShape Requires<BodyOrientation> anyway.
This commit is contained in:
reaperrr
2021-05-30 21:36:28 +02:00
committed by Paul Chote
parent 6d55161043
commit feba9f2b9f

View File

@@ -69,16 +69,18 @@ namespace OpenRA.Mods.Common.Traits
public class HitShape : ConditionalTrait<HitShapeInfo>, ITargetablePositions
{
BodyOrientation orientation;
readonly BodyOrientation orientation;
ITargetableCells targetableCells;
Turreted turret;
public HitShape(Actor self, HitShapeInfo info)
: base(info) { }
: base(info)
{
orientation = self.Trait<BodyOrientation>();
}
protected override void Created(Actor self)
{
orientation = self.Trait<BodyOrientation>();
targetableCells = self.TraitOrDefault<ITargetableCells>();
turret = self.TraitsImplementing<Turreted>().FirstOrDefault(t => t.Name == Info.Turret);