From d706c317664e9cad2e3504fc97883b947a9a2323 Mon Sep 17 00:00:00 2001 From: hnt_ts Date: Sun, 10 Aug 2008 16:28:25 +0000 Subject: [PATCH] Added an new CON command: activatecheat git-svn-id: https://svn.eduke32.com/eduke32@964 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/gamedef.c | 2 ++ polymer/eduke32/source/gamedef.h | 1 + polymer/eduke32/source/gameexec.c | 12 ++++++++++++ 3 files changed, 15 insertions(+) diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index bd79cd583..d73c8396c 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -466,6 +466,7 @@ static const char *keyw[] = "definegamename", // 330 "cmenu", // 331 "gettimedate", // 332 + "activatecheat", // 333 "" }; @@ -3435,6 +3436,7 @@ static int parsecommand(void) case CON_USERQUOTE: case CON_STARTTRACKVAR: case CON_CLEARMAPSTATE: + case CON_ACTIVATECHEAT: transvar(); return 0; diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index af93184e5..22ab8a92b 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -843,4 +843,5 @@ enum keywords CON_DEFINEGAMENAME, // 330 CON_CMENU, // 331 CON_GETTIMEDATE, // 332 + CON_ACTIVATECHEAT, // 333 }; diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 74d13e207..b74a4bd9f 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "duke3d.h" #include "gamedef.h" #include "scriplib.h" +#include "osdcmds.h" #include "osd.h" @@ -7505,6 +7506,17 @@ static int parse(void) playmusic(&map[(unsigned char)music_select].musicfn[0],music_select); break; + case CON_ACTIVATECHEAT: + insptr++; + j=GetGameVarID(*(insptr++), g_i, g_p); + if (numplayers != 1 || !(g_player[myconnectindex].ps->gm & MODE_GAME)) + { + OSD_Printf(CON_ERROR "CON_ACTIVATECHEAT: Not in a single-player game.\n"); + break; + } + osdcmd_cheatsinfo_stat.cheatnum = j; + break; + case CON_GETTEXTURECEILING: insptr++; SetGameVarID(g_iTextureID, sector[g_sp->sectnum].ceilingpicnum, g_i, g_p);