From 7ebf47553c6fd14a7b79ce54e013f74496ccf88c Mon Sep 17 00:00:00 2001
From: Joshua Davidson <joshuadavidson2000@gmail.com>
Date: Wed, 22 Aug 2018 15:50:55 -0400
Subject: [PATCH] System: Fix autobrake bug

---
 Nasal/brakes.nas | 3 ++-
 revision.txt     | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Nasal/brakes.nas b/Nasal/brakes.nas
index a9f320df..7ba9422c 100644
--- a/Nasal/brakes.nas
+++ b/Nasal/brakes.nas
@@ -36,6 +36,7 @@ controls.applyBrakes = func(v, which = 0) {
 # Set autobrake mode
 var arm_autobrake = func(mode) {
 	wow0 = getprop("/gear/gear[0]/wow");
+	gnd_speed = getprop("/velocities/groundspeed-kt");
 	if (mode == 0) { # OFF
 		absChk.stop();
 		if (getprop("/controls/autobrake/active") == 1) {
@@ -53,7 +54,7 @@ var arm_autobrake = func(mode) {
 		setprop("/controls/autobrake/decel-rate", 3);
 		setprop("/controls/autobrake/mode", 2);
 		absChk.start();
-	} else if (mode == 3 and wow0 == 1) { # MAX
+	} else if (mode == 3 and wow0 == 1 and gnd_speed < 40) { # MAX
 		setprop("/controls/autobrake/decel-rate", 6);
 		setprop("/controls/autobrake/mode", 3);
 		absChk.start();
diff --git a/revision.txt b/revision.txt
index 0d7efe04..c30bc7d5 100644
--- a/revision.txt
+++ b/revision.txt
@@ -1 +1 @@
-4624
\ No newline at end of file
+4625
\ No newline at end of file