Merge pull request #9716 from teees/hover-fix
Disable hovering for landed aircraft
This commit is contained in:
@@ -18,20 +18,21 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("Changes the visual Z position periodically.")]
|
||||
public class HoversInfo : ITraitInfo, Requires<IMoveInfo>
|
||||
public class HoversInfo : UpgradableTraitInfo, Requires<IMoveInfo>
|
||||
{
|
||||
[Desc("Amount of Z axis changes in world units.")]
|
||||
public readonly int OffsetModifier = -43;
|
||||
|
||||
public object Create(ActorInitializer init) { return new Hovers(this, init.Self); }
|
||||
public override object Create(ActorInitializer init) { return new Hovers(this, init.Self); }
|
||||
}
|
||||
|
||||
public class Hovers : IRenderModifier
|
||||
public class Hovers : UpgradableTrait<HoversInfo>, IRenderModifier
|
||||
{
|
||||
readonly HoversInfo info;
|
||||
readonly bool aircraft;
|
||||
|
||||
public Hovers(HoversInfo info, Actor self)
|
||||
: base(info)
|
||||
{
|
||||
this.info = info;
|
||||
aircraft = self.Info.HasTraitInfo<AircraftInfo>();
|
||||
@@ -39,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public IEnumerable<IRenderable> ModifyRender(Actor self, WorldRenderer wr, IEnumerable<IRenderable> r)
|
||||
{
|
||||
if (self.World.Paused)
|
||||
if (self.World.Paused || IsTraitDisabled)
|
||||
return r;
|
||||
|
||||
var visualOffset = !aircraft || self.CenterPosition.Z > 0 ? (int)Math.Abs((self.ActorID + Game.LocalTick) / 5 % 4 - 1) - 1 : 0;
|
||||
|
||||
@@ -97,7 +97,9 @@ ORCA:
|
||||
PipTypeEmpty: AmmoEmpty
|
||||
AutoTarget:
|
||||
RenderSprites:
|
||||
Hovers:
|
||||
Hovers@AIRBORNE:
|
||||
UpgradeTypes: airborne
|
||||
UpgradeMinEnabledLevel: 1
|
||||
|
||||
ORCAB:
|
||||
Inherits: ^Plane
|
||||
@@ -139,7 +141,9 @@ ORCAB:
|
||||
PipTypeEmpty: AmmoEmpty
|
||||
AutoTarget:
|
||||
RenderSprites:
|
||||
Hovers:
|
||||
Hovers@AIRBORNE:
|
||||
UpgradeTypes: airborne
|
||||
UpgradeMinEnabledLevel: 1
|
||||
|
||||
ORCATRAN:
|
||||
Inherits: ^Helicopter
|
||||
@@ -172,7 +176,9 @@ ORCATRAN:
|
||||
MaxWeight: 5
|
||||
PipCount: 5
|
||||
UnloadVoice: Move
|
||||
Hovers:
|
||||
Hovers@AIRBORNE:
|
||||
UpgradeTypes: airborne
|
||||
UpgradeMinEnabledLevel: 1
|
||||
|
||||
TRNSPORT:
|
||||
Inherits: ^Helicopter
|
||||
@@ -202,7 +208,9 @@ TRNSPORT:
|
||||
Range: 2c0
|
||||
Type: CenterPosition
|
||||
RenderSprites:
|
||||
Hovers:
|
||||
Hovers@AIRBORNE:
|
||||
UpgradeTypes: airborne
|
||||
UpgradeMinEnabledLevel: 1
|
||||
Selectable:
|
||||
Bounds: 44,32,0,-8
|
||||
|
||||
@@ -285,7 +293,9 @@ APACHE:
|
||||
WithSpriteRotorOverlay:
|
||||
Offset: 85,0,384
|
||||
RenderSprites:
|
||||
Hovers:
|
||||
Hovers@AIRBORNE:
|
||||
UpgradeTypes: airborne
|
||||
UpgradeMinEnabledLevel: 1
|
||||
|
||||
HUNTER:
|
||||
Inherits@1: ^GainsExperience
|
||||
|
||||
Reference in New Issue
Block a user