diff --git a/Nasal/electrical.nas b/Nasal/electrical.nas index e5ebbc3a..78f6e11e 100644 --- a/Nasal/electrical.nas +++ b/Nasal/electrical.nas @@ -621,6 +621,8 @@ var ELEC = { setprop("/systems/electrical/battery1-percent", battery1_percent_calc); setprop("/systems/electrical/battery1-time", getprop("/sim/time/elapsed-sec")); } + } else if (battery1_percent == 100 and (dc1 > 25 or dc2 > 25) and battery1_sw and !batt1_fail) { + setprop("/systems/electrical/battery1-time", getprop("/sim/time/elapsed-sec")); } else if (battery1_amps >= 120 and battery1_sw and !batt1_fail) { if (getprop("/systems/electrical/battery1-time") + 5 < getprop("/sim/time/elapsed-sec")) { battery1_percent_calc = battery1_percent - 0.25; # Roughly 90 percent every 30 mins @@ -643,6 +645,8 @@ var ELEC = { setprop("/systems/electrical/battery2-percent", battery2_percent_calc); setprop("/systems/electrical/battery2-time", getprop("/sim/time/elapsed-sec")); } + } else if (battery2_percent == 100 and (dc1 > 25 or dc2 > 25) and battery2_sw and !batt2_fail) { + setprop("/systems/electrical/battery2-time", getprop("/sim/time/elapsed-sec")); } else if (battery2_amps >= 120 and battery2_sw and !batt2_fail) { if (getprop("/systems/electrical/battery2-time") + 5 < getprop("/sim/time/elapsed-sec")) { battery2_percent_calc = battery2_percent - 0.25; # Roughly 90 percent every 30 mins diff --git a/Nasal/libraries.nas b/Nasal/libraries.nas index b0f08cae..28bf90bb 100644 --- a/Nasal/libraries.nas +++ b/Nasal/libraries.nas @@ -9,6 +9,8 @@ print("------------------------------------------------------------------------- print("Copyright (c) 2017-2018 Joshua Davidson (it0uchpods)"); print("-----------------------------------------------------------------------------"); +setprop("/sim/replay/was-active", 0); + # Dimmers setprop("/controls/lighting/ndl-norm", 1); setprop("/controls/lighting/ndr-norm", 1); @@ -206,7 +208,7 @@ var systemsLoop = maketimer(0.1, func { libraries.ECAM.loop(); ecam.ECAM_controller.loop(); fadec.fadecLoop(); - + if ((getprop("/controls/pneumatic/switches/groundair") or getprop("/controls/switches/cart")) and ((getprop("/velocities/groundspeed-kt") > 2) or getprop("/controls/gear/brake-parking") == 0)) { setprop("/controls/switches/cart", 0); setprop("/controls/pneumatic/switches/groundair", 0); @@ -246,6 +248,14 @@ var systemsLoop = maketimer(0.1, func { if ((getprop("/engines/engine[1]/state") == 2 or getprop("/engines/engine[1]/state") == 3) and getprop("/fdm/jsbsim/propulsion/tank[4]/contents-lbs") < 1) { systems.cutoff_two(); } + + if (getprop("/sim/replay/replay-state") == 1) { + setprop("/sim/replay/was-active", 1); + } else if (getprop("/sim/replay/replay-state") == 0 and getprop("/sim/replay/was-active") == 1) { + setprop("/sim/replay/was-active", 0); + acconfig.colddark(); + gui.popupTip("Replay Ended: Setting Cold and Dark state..."); + } }); setlistener("/options/steep-ils", func { diff --git a/revision.txt b/revision.txt index 9e2c8d60..5c38a199 100644 --- a/revision.txt +++ b/revision.txt @@ -1 +1 @@ -4504 \ No newline at end of file +4506 \ No newline at end of file