From 6ea53840c9cb9b99c41fbb4d87a1acac8c0889e5 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Fri, 1 Mar 2013 10:19:54 +0100 Subject: SLIMaxMgr III beta --- scripts/global.lua | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) (limited to 'scripts/global.lua') diff --git a/scripts/global.lua b/scripts/global.lua index 2d6cf3e..39bde4a 100755 --- a/scripts/global.lua +++ b/scripts/global.lua @@ -412,29 +412,26 @@ function SetDeltaTimeDelay(delay) mDeltatimeDelay = delay end --- get current gear (even when engine/ignition is off) +-- get current gear function GetCurrentGear() - local g = GetCarInfo("gear") - -- get neutral - local n = GetContextInfo("neutral") - -- get reverse char and convert to string - local r = string.char(GetContextInfo("reverse")) - -- get state of custom Optimal Shift Point (OSP) records - local ospcustom_on = GetContextInfo("ospcustom") - - -- set neutral, reverse or current gear - local result = g - - if g == 0 then - -- if neutral and using custom OSP record then add a dot to gear digit - if ospcustom_on then n = n + 128 end - result = string.char(n) - elseif g < 0 then - -- reverse - result = r - end + local g = GetCarInfo("gear") + -- get neutral + local n = string.char(GetContextInfo("neutral")) + -- get reverse char and convert to string + local r = string.char(GetContextInfo("reverse")) + + -- set neutral, reverse or current gear + local result = g + + if g == 0 then + -- neutral + result = n + elseif g < 0 then + -- reverse + result = r + end - return result + return result end -- cgit v1.2.3