Fix potential NRE in Parachutable
This commit is contained in:
@@ -16,7 +16,7 @@ using OpenRA.Traits;
|
|||||||
namespace OpenRA.Mods.Common.Traits
|
namespace OpenRA.Mods.Common.Traits
|
||||||
{
|
{
|
||||||
[Desc("Can be paradropped by a ParaDrop actor.")]
|
[Desc("Can be paradropped by a ParaDrop actor.")]
|
||||||
class ParachutableInfo : ITraitInfo
|
class ParachutableInfo : ITraitInfo, Requires<IPositionableInfo>
|
||||||
{
|
{
|
||||||
[Desc("If we land on invalid terrain for my actor type should we be killed?")]
|
[Desc("If we land on invalid terrain for my actor type should we be killed?")]
|
||||||
public readonly bool KilledOnImpassableTerrain = true;
|
public readonly bool KilledOnImpassableTerrain = true;
|
||||||
@@ -51,8 +51,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
{
|
{
|
||||||
self = init.Self;
|
self = init.Self;
|
||||||
this.info = info;
|
this.info = info;
|
||||||
|
positionable = self.Trait<IPositionable>();
|
||||||
positionable = self.TraitOrDefault<IPositionable>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void INotifyParachuteLanded.OnLanded(Actor ignore)
|
void INotifyParachuteLanded.OnLanded(Actor ignore)
|
||||||
|
|||||||
Reference in New Issue
Block a user