Make orientation caching in HitShape readonly
HitShape Requires<BodyOrientation> anyway.
This commit is contained in:
@@ -69,16 +69,18 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
public class HitShape : ConditionalTrait<HitShapeInfo>, ITargetablePositions
|
public class HitShape : ConditionalTrait<HitShapeInfo>, ITargetablePositions
|
||||||
{
|
{
|
||||||
BodyOrientation orientation;
|
readonly BodyOrientation orientation;
|
||||||
ITargetableCells targetableCells;
|
ITargetableCells targetableCells;
|
||||||
Turreted turret;
|
Turreted turret;
|
||||||
|
|
||||||
public HitShape(Actor self, HitShapeInfo info)
|
public HitShape(Actor self, HitShapeInfo info)
|
||||||
: base(info) { }
|
: base(info)
|
||||||
|
{
|
||||||
|
orientation = self.Trait<BodyOrientation>();
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Created(Actor self)
|
protected override void Created(Actor self)
|
||||||
{
|
{
|
||||||
orientation = self.Trait<BodyOrientation>();
|
|
||||||
targetableCells = self.TraitOrDefault<ITargetableCells>();
|
targetableCells = self.TraitOrDefault<ITargetableCells>();
|
||||||
turret = self.TraitsImplementing<Turreted>().FirstOrDefault(t => t.Name == Info.Turret);
|
turret = self.TraitsImplementing<Turreted>().FirstOrDefault(t => t.Name == Info.Turret);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user