foxygit / doom Log in
commit 892ad7c072a6717e8935053d7837a33974d0d824
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Sat Nov 21 00:40:58 2009 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Sat Nov 21 00:40:58 2009 +0000

    Apply configuration file invalid key setting fix to setup code.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 1733
---
 setup/configfile.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/setup/configfile.c b/setup/configfile.c
index 6d57a107..99ec2e03 100644
--- a/setup/configfile.c
+++ b/setup/configfile.c
@@ -532,7 +532,15 @@ static void LoadDefaultCollection(default_collection_t *collection)

                     intparm = ParseIntParameter(strparm);
                     defaults[i].untranslated = intparm;
-                    intparm = scantokey[intparm];
+
+                    if (intparm >= 0 && intparm < 128)
+                    {
+                        intparm = scantokey[intparm];
+                    }
+                    else
+                    {
+                        intparm = 0;
+                    }

                     defaults[i].original_translated = intparm;
                     * (int *) def->location = intparm;