From 6f5bc05289371ff6613b958676c03942214bf66e Mon Sep 17 00:00:00 2001 From: Elfiwolfe Date: Thu, 6 Oct 2016 17:34:27 -0700 Subject: [PATCH] Add properity MaxEffectiveThrust Adds MaxEffectiveThrust that is adjusted for planetary and atmosphere influence --- Sources/Sandbox.Common/ModAPI/Ingame/IMyThrust.cs | 5 +++++ Sources/Sandbox.Game/Game/Entities/Blocks/MyThrust.cs | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/Sources/Sandbox.Common/ModAPI/Ingame/IMyThrust.cs b/Sources/Sandbox.Common/ModAPI/Ingame/IMyThrust.cs index 9ea8ef688..9318987fd 100644 --- a/Sources/Sandbox.Common/ModAPI/Ingame/IMyThrust.cs +++ b/Sources/Sandbox.Common/ModAPI/Ingame/IMyThrust.cs @@ -17,6 +17,11 @@ public interface IMyThrust: IMyFunctionalBlock /// float MaxThrust { get; } + /// + /// Gets the maximum effective thrust amount, in Newtons (N) + /// + float MaxEffectiveThrust { get; } + /// /// Gets the current thrust amount, in Newtons (N) /// diff --git a/Sources/Sandbox.Game/Game/Entities/Blocks/MyThrust.cs b/Sources/Sandbox.Game/Game/Entities/Blocks/MyThrust.cs index 236ff5aae..8b2df2c82 100644 --- a/Sources/Sandbox.Game/Game/Entities/Blocks/MyThrust.cs +++ b/Sources/Sandbox.Game/Game/Entities/Blocks/MyThrust.cs @@ -695,6 +695,14 @@ float Sandbox.ModAPI.Ingame.IMyThrust.MaxThrust } } + float Sandbox.ModAPI.Ingame.IMyThrust.MaxEffectiveThrust + { + get + { + return BlockDefinition.ForceMagnitude * m_thrustMultiplier * m_thrustComponent.GetLastThrustMultiplier(this); + } + } + float Sandbox.ModAPI.Ingame.IMyThrust.CurrentThrust { get