foxygit / doom Log in
commit 3579a07a56d6bdd2150e6d3a07817b60b53cea20
Author:     Simon Howard <fraggle@gmail.com>
AuthorDate: Fri Oct 27 23:15:23 2006 +0000
Commit:     Simon Howard <fraggle@gmail.com>
CommitDate: Fri Oct 27 23:15:23 2006 +0000

    Allow multiple dehacked patches to be specified with the -deh command
    line paramter, as with -file.

    Subversion-branch: /trunk/chocolate-doom
    Subversion-revision: 741
---
 src/deh_main.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/deh_main.c b/src/deh_main.c
index 5da6b0bf..8f82b5bb 100644
--- a/src/deh_main.c
+++ b/src/deh_main.c
@@ -335,16 +335,22 @@ static void DEH_ParseFile(char *filename)

 void DEH_Init(void)
 {
-    int argc;
+    int p;

     InitialiseSections();

-    argc = M_CheckParm("-deh");
+    p = M_CheckParm("-deh");

-    if (argc > 0)
+    if (p > 0)
     {
-        printf(" loading %s\n", myargv[argc+1]);
-        DEH_ParseFile(myargv[argc+1]);
+        ++p;
+
+        while (p < myargc && myargv[p][0] != '-')
+        {
+            printf(" loading %s\n", myargv[p]);
+            DEH_ParseFile(myargv[p]);
+            ++p;
+        }
     }
 }