Added an new CON command: activatecheat <cheatID>

git-svn-id: https://svn.eduke32.com/eduke32@964 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hnt_ts 2008-08-10 16:28:25 +00:00
parent dae0f54b9a
commit d706c31766
3 changed files with 15 additions and 0 deletions

View file

@ -466,6 +466,7 @@ static const char *keyw[] =
"definegamename", // 330 "definegamename", // 330
"cmenu", // 331 "cmenu", // 331
"gettimedate", // 332 "gettimedate", // 332
"activatecheat", // 333
"<null>" "<null>"
}; };
@ -3435,6 +3436,7 @@ static int parsecommand(void)
case CON_USERQUOTE: case CON_USERQUOTE:
case CON_STARTTRACKVAR: case CON_STARTTRACKVAR:
case CON_CLEARMAPSTATE: case CON_CLEARMAPSTATE:
case CON_ACTIVATECHEAT:
transvar(); transvar();
return 0; return 0;

View file

@ -843,4 +843,5 @@ enum keywords
CON_DEFINEGAMENAME, // 330 CON_DEFINEGAMENAME, // 330
CON_CMENU, // 331 CON_CMENU, // 331
CON_GETTIMEDATE, // 332 CON_GETTIMEDATE, // 332
CON_ACTIVATECHEAT, // 333
}; };

View file

@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "duke3d.h" #include "duke3d.h"
#include "gamedef.h" #include "gamedef.h"
#include "scriplib.h" #include "scriplib.h"
#include "osdcmds.h"
#include "osd.h" #include "osd.h"
@ -7505,6 +7506,17 @@ static int parse(void)
playmusic(&map[(unsigned char)music_select].musicfn[0],music_select); playmusic(&map[(unsigned char)music_select].musicfn[0],music_select);
break; 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: case CON_GETTEXTURECEILING:
insptr++; insptr++;
SetGameVarID(g_iTextureID, sector[g_sp->sectnum].ceilingpicnum, g_i, g_p); SetGameVarID(g_iTextureID, sector[g_sp->sectnum].ceilingpicnum, g_i, g_p);