foxygit / doom Log in
commit 38da738fd72f18b44d05d30450cb0d3d4d7aefe5
Author:     Nuke.YKT <alexeytf2@gmail.com>
AuthorDate: Sun Jul 26 21:00:54 2015 +0900
Commit:     Nuke.YKT <alexeytf2@gmail.com>
CommitDate: Sun Jul 26 21:00:54 2015 +0900

    doom:Chex's warp cheat handling fix

    Chex Quest exe also prevents maps highter than 5
---
 src/doom/st_stuff.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/doom/st_stuff.c b/src/doom/st_stuff.c
index e00d1edc..29eb0a88 100644
--- a/src/doom/st_stuff.c
+++ b/src/doom/st_stuff.c
@@ -618,13 +618,21 @@ ST_Responder (event_t* ev)
       {
 	epsd = buf[0] - '0';
 	map = buf[1] - '0';
-      }

-      // Chex.exe always warps to episode 1.
+    // Chex.exe always warps to episode 1.
+
+    if (gameversion == exe_chex)
+    {
+        if (epsd > 1)
+        {
+            epsd = 1;
+        }
+        if (map > 5)
+        {
+            map = 5;
+        }
+    }

-      if (gameversion == exe_chex)
-      {
-        epsd = 1;
       }

       // Catch invalid maps.