diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 58c2ee0a7..393384c1c 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1083,6 +1083,7 @@ void D_RegisterClientCommands(void) COM_AddCommand("god", Command_CheatGod_f); COM_AddCommand("setrings", Command_Setrings_f); COM_AddCommand("setlives", Command_Setlives_f); + COM_AddCommand("setscore", Command_Setscore_f); COM_AddCommand("devmode", Command_Devmode_f); COM_AddCommand("savecheckpoint", Command_Savecheckpoint_f); COM_AddCommand("scale", Command_Scale_f); @@ -2051,6 +2052,10 @@ void D_Cheat(INT32 playernum, INT32 cheat, ...) COPY(WRITESINT8, int); COPY(WRITEUINT8, unsigned int); break; + + case CHEAT_SCORE: + COPY(WRITEUINT32, UINT32); + break; } #undef COPY @@ -5739,6 +5744,15 @@ static void Got_Cheat(UINT8 **cp, INT32 playernum) break; } + case CHEAT_SCORE: { + UINT32 score = READUINT32(*cp); + + player->roundscore = score; + + CV_CheaterWarning(targetPlayer, va("score = %u", score)); + break; + } + case NUMBER_OF_CHEATS: break; } diff --git a/src/m_cheat.c b/src/m_cheat.c index 582b339f6..62a5a2b53 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -763,6 +763,14 @@ void Command_Setlives_f(void) D_Cheat(consoleplayer, CHEAT_LIVES, atoi(COM_Argv(1))); } +void Command_Setscore_f(void) +{ + REQUIRE_CHEATS; + REQUIRE_INLEVEL; + + D_Cheat(consoleplayer, CHEAT_SCORE, atoi(COM_Argv(1))); +} + void Command_Grayscale_f(void) { REQUIRE_CHEATS; diff --git a/src/m_cheat.h b/src/m_cheat.h index b8b85db00..331f70563 100644 --- a/src/m_cheat.h +++ b/src/m_cheat.h @@ -35,6 +35,7 @@ typedef enum { CHEAT_RELATIVE_TELEPORT, CHEAT_DEVMODE, CHEAT_GIVEITEM, + CHEAT_SCORE, NUMBER_OF_CHEATS } cheat_t; @@ -71,6 +72,7 @@ void Command_CheatGod_f(void); void Command_Savecheckpoint_f(void); void Command_Setrings_f(void); void Command_Setlives_f(void); +void Command_Setscore_f(void); void Command_Devmode_f(void); void Command_Scale_f(void); void Command_Gravflip_f(void);