shithub: riscv

Download patch

ref: f47f6af382228431fa363198ebf9d6d9424c5b56
parent: 0d76dafaa023ec68abae9e92961e6619397c76e6
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Aug 16 18:08:11 EDT 2015

games/doom: fix idclev cheat in doom2 and final doom (thanks qu7uux)

a typo in st_stuff.c:ST_Responder prevents idclev (change level) cheat to work
in doom2 and final doom (gamemode == commercial): episode is set to 0, when
that's invalid, and ST_Responder just returns.
to test, while ingame type idclev, followed by:
. doom1: episode (1-3 or 1-4) then map number (1-9)
. doom2/final doom: map number (1-32)
incidentally, if the last digit typed is 1, the player's weapon will switch to
the fist, because of a different bug (basically kbdproc registering two events
when pressing a key, for 'c' and 'k' case).

--- a/sys/src/games/doom/st_stuff.c
+++ b/sys/src/games/doom/st_stuff.c
@@ -680,7 +680,7 @@
       
       if (gamemode == commercial)
       {
-	epsd = 0;
+	epsd = 1;
 	map = (buf[0] - '0')*10 + buf[1] - '0';
       }
       else