diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 7c7397d6a..da601171e 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -6966,6 +6966,7 @@ skip: #pragma optimize("",on) #endif +// KEEPINSYNC game.h: enum cheatindex_t char CheatStrings[][MAXCHEATLEN] = { "cornholio", // 0 @@ -6997,37 +6998,6 @@ char CheatStrings[][MAXCHEATLEN] = "cgs", // 26 }; -enum cheatindex_t -{ - CHEAT_CORNHOLIO, - CHEAT_STUFF, - CHEAT_SCOTTY, - CHEAT_COORDS, - CHEAT_VIEW, - CHEAT_TIME, - CHEAT_UNLOCK, - CHEAT_CASHMAN, - CHEAT_ITEMS, - CHEAT_RATE, - CHEAT_SKILL, - CHEAT_BETA, - CHEAT_HYPER, - CHEAT_MONSTERS, - CHEAT_RESERVED, - CHEAT_RESERVED2, - CHEAT_TODD, - CHEAT_SHOWMAP, - CHEAT_KROZ, - CHEAT_ALLEN, - CHEAT_CLIP, - CHEAT_WEAPONS, - CHEAT_INVENTORY, - CHEAT_KEYS, - CHEAT_DEBUG, - CHEAT_RESERVED3, - CHEAT_COMEGETSOME, -}; - static void doinvcheat(int32_t invidx, int32_t defaultnum, int32_t event) { defaultnum = VM_OnEvent(event, g_player[myconnectindex].ps->i, myconnectindex, -1, defaultnum); diff --git a/polymer/eduke32/source/game.h b/polymer/eduke32/source/game.h index 3322fe037..2c1cfcd63 100644 --- a/polymer/eduke32/source/game.h +++ b/polymer/eduke32/source/game.h @@ -371,6 +371,40 @@ enum { ST_31_TWO_WAY_TRAIN = 31, }; +// Cheats +// KEEPINSYNC game.c: char CheatStrings[][] +enum cheatindex_t +{ + CHEAT_CORNHOLIO, // 0 + CHEAT_STUFF, + CHEAT_SCOTTY, + CHEAT_COORDS, + CHEAT_VIEW, + CHEAT_TIME, // 5 + CHEAT_UNLOCK, + CHEAT_CASHMAN, + CHEAT_ITEMS, + CHEAT_RATE, + CHEAT_SKILL, // 10 + CHEAT_BETA, + CHEAT_HYPER, + CHEAT_MONSTERS, + CHEAT_RESERVED, + CHEAT_RESERVED2, // 15 + CHEAT_TODD, + CHEAT_SHOWMAP, + CHEAT_KROZ, + CHEAT_ALLEN, + CHEAT_CLIP, // 20 + CHEAT_WEAPONS, + CHEAT_INVENTORY, + CHEAT_KEYS, + CHEAT_DEBUG, + CHEAT_RESERVED3, // 25 + CHEAT_COMEGETSOME, +}; + + # define G_ModDirSnprintf(buf, size, basename, ...) \ ( \ ( \ diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index a8fd4c194..dd478df6a 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -136,7 +136,7 @@ static int32_t osdcmd_changelevel(const osdfuncparm_t *parm) if (g_player[myconnectindex].ps->gm & MODE_GAME) { // in-game behave like a cheat - osdcmd_cheatsinfo_stat.cheatnum = 2; + osdcmd_cheatsinfo_stat.cheatnum = CHEAT_SCOTTY; osdcmd_cheatsinfo_stat.volume = volume; osdcmd_cheatsinfo_stat.level = level; } @@ -298,7 +298,7 @@ static int32_t osdcmd_god(const osdfuncparm_t *parm) { UNREFERENCED_PARAMETER(parm); if (numplayers == 1 && g_player[myconnectindex].ps->gm & MODE_GAME) - osdcmd_cheatsinfo_stat.cheatnum = 0; + osdcmd_cheatsinfo_stat.cheatnum = CHEAT_CORNHOLIO; else OSD_Printf("god: Not in a single-player game.\n"); @@ -310,7 +310,7 @@ static int32_t osdcmd_noclip(const osdfuncparm_t *parm) UNREFERENCED_PARAMETER(parm); if (numplayers == 1 && g_player[myconnectindex].ps->gm & MODE_GAME) { - osdcmd_cheatsinfo_stat.cheatnum = 20; + osdcmd_cheatsinfo_stat.cheatnum = CHEAT_CLIP; } else { @@ -644,7 +644,7 @@ static int32_t osdcmd_give(const osdfuncparm_t *parm) if (!Bstrcasecmp(parm->parms[0], "all")) { - osdcmd_cheatsinfo_stat.cheatnum = 1; + osdcmd_cheatsinfo_stat.cheatnum = CHEAT_STUFF; return OSDCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "health")) @@ -654,7 +654,7 @@ static int32_t osdcmd_give(const osdfuncparm_t *parm) } else if (!Bstrcasecmp(parm->parms[0], "weapons")) { - osdcmd_cheatsinfo_stat.cheatnum = 21; + osdcmd_cheatsinfo_stat.cheatnum = CHEAT_WEAPONS; return OSDCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "ammo")) @@ -670,12 +670,12 @@ static int32_t osdcmd_give(const osdfuncparm_t *parm) } else if (!Bstrcasecmp(parm->parms[0], "keys")) { - osdcmd_cheatsinfo_stat.cheatnum = 23; + osdcmd_cheatsinfo_stat.cheatnum = CHEAT_KEYS; return OSDCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "inventory")) { - osdcmd_cheatsinfo_stat.cheatnum = 22; + osdcmd_cheatsinfo_stat.cheatnum = CHEAT_INVENTORY; return OSDCMD_OK; } return OSDCMD_SHOWHELP;