From ba444e1e382881d29eb60f913e0503ea950947a2 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Tue, 26 Feb 2008 08:28:32 +0000
Subject: [PATCH] Properly fill in default values for zero-length entries.

---
 xtrn/tw2/input.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xtrn/tw2/input.js b/xtrn/tw2/input.js
index 217d2e2d54..bbbd76004a 100644
--- a/xtrn/tw2/input.js
+++ b/xtrn/tw2/input.js
@@ -138,6 +138,14 @@ InputFuncMainLoop:
 		}
 	}
 
+	/* Look for a default value */
+	if(pos==0) {
+		for(value in values) {
+			if(typeof(values[value])=='object' && values[value].def != undefined) {
+				matchval=values[value].def;
+			}
+		}
+	}
 	while(pos > 0) {
 		console.write('\x08');
 		pos--;
-- 
GitLab