diff options
author | Eddi-z <43699911+Eddi-z@users.noreply.github.com> | 2019-01-05 22:10:37 +0100 |
---|---|---|
committer | Ingo von Borstel <github@planetmaker.de> | 2019-01-05 22:10:37 +0100 |
commit | 13056aedbc0a6c22704a525c1395980d887e0ad2 (patch) | |
tree | 203f6ae42080094d4940675eabbc15b6f5cccb51 /src/script | |
parent | 96b961c69a7be052b9104994b73801b32b5e1c41 (diff) | |
download | openttd-13056aedbc0a6c22704a525c1395980d887e0ad2.tar.xz |
Add: Conditional order for max. reliability (patch by Cirdan, #6360) (#7017)
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/api/ai/ai_order.hpp.sq | 1 | ||||
-rw-r--r-- | src/script/api/game/game_order.hpp.sq | 1 | ||||
-rw-r--r-- | src/script/api/script_order.cpp | 1 | ||||
-rw-r--r-- | src/script/api/script_order.hpp | 1 |
4 files changed, 4 insertions, 0 deletions
diff --git a/src/script/api/ai/ai_order.hpp.sq b/src/script/api/ai/ai_order.hpp.sq index 71cc8cfe9..ab25e4810 100644 --- a/src/script/api/ai/ai_order.hpp.sq +++ b/src/script/api/ai/ai_order.hpp.sq @@ -44,6 +44,7 @@ void SQAIOrder_Register(Squirrel *engine) SQAIOrder.DefSQConst(engine, ScriptOrder::OF_INVALID, "OF_INVALID"); SQAIOrder.DefSQConst(engine, ScriptOrder::OC_LOAD_PERCENTAGE, "OC_LOAD_PERCENTAGE"); SQAIOrder.DefSQConst(engine, ScriptOrder::OC_RELIABILITY, "OC_RELIABILITY"); + SQAIOrder.DefSQConst(engine, ScriptOrder::OC_MAX_RELIABILITY, "OC_MAX_RELIABILITY"); SQAIOrder.DefSQConst(engine, ScriptOrder::OC_MAX_SPEED, "OC_MAX_SPEED"); SQAIOrder.DefSQConst(engine, ScriptOrder::OC_AGE, "OC_AGE"); SQAIOrder.DefSQConst(engine, ScriptOrder::OC_REQUIRES_SERVICE, "OC_REQUIRES_SERVICE"); diff --git a/src/script/api/game/game_order.hpp.sq b/src/script/api/game/game_order.hpp.sq index f95dce925..e2126c603 100644 --- a/src/script/api/game/game_order.hpp.sq +++ b/src/script/api/game/game_order.hpp.sq @@ -44,6 +44,7 @@ void SQGSOrder_Register(Squirrel *engine) SQGSOrder.DefSQConst(engine, ScriptOrder::OF_INVALID, "OF_INVALID"); SQGSOrder.DefSQConst(engine, ScriptOrder::OC_LOAD_PERCENTAGE, "OC_LOAD_PERCENTAGE"); SQGSOrder.DefSQConst(engine, ScriptOrder::OC_RELIABILITY, "OC_RELIABILITY"); + SQGSOrder.DefSQConst(engine, ScriptOrder::OC_MAX_RELIABILITY, "OC_MAX_RELIABILITY"); SQGSOrder.DefSQConst(engine, ScriptOrder::OC_MAX_SPEED, "OC_MAX_SPEED"); SQGSOrder.DefSQConst(engine, ScriptOrder::OC_AGE, "OC_AGE"); SQGSOrder.DefSQConst(engine, ScriptOrder::OC_REQUIRES_SERVICE, "OC_REQUIRES_SERVICE"); diff --git a/src/script/api/script_order.cpp b/src/script/api/script_order.cpp index 676262dc7..a1390bf8f 100644 --- a/src/script/api/script_order.cpp +++ b/src/script/api/script_order.cpp @@ -214,6 +214,7 @@ static int ScriptOrderPositionToRealOrderPosition(VehicleID vehicle_id, ScriptOr switch (condition) { case OC_LOAD_PERCENTAGE: case OC_RELIABILITY: + case OC_MAX_RELIABILITY: case OC_MAX_SPEED: case OC_AGE: case OC_REMAINING_LIFETIME: diff --git a/src/script/api/script_order.hpp b/src/script/api/script_order.hpp index 63089a2bd..a4f945511 100644 --- a/src/script/api/script_order.hpp +++ b/src/script/api/script_order.hpp @@ -91,6 +91,7 @@ public: /* Note: these values represent part of the in-game OrderConditionVariable enum */ OC_LOAD_PERCENTAGE = ::OCV_LOAD_PERCENTAGE, ///< Skip based on the amount of load, value is in tons. OC_RELIABILITY = ::OCV_RELIABILITY, ///< Skip based on the reliability, value is percent (0..100). + OC_MAX_RELIABILITY = ::OCV_MAX_RELIABILITY, ///< Skip based on the maximum reliability. Value in percent OC_MAX_SPEED = ::OCV_MAX_SPEED, ///< Skip based on the maximum speed, value is in OpenTTD's internal speed unit, see ScriptEngine::GetMaxSpeed. OC_AGE = ::OCV_AGE, ///< Skip based on the age, value is in years. OC_REQUIRES_SERVICE = ::OCV_REQUIRES_SERVICE, ///< Skip when the vehicle requires service, no value. |