mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add setspheres command
This commit is contained in:
parent
5546f7e7a7
commit
427ab44471
3 changed files with 26 additions and 0 deletions
|
|
@ -1118,6 +1118,7 @@ void D_RegisterClientCommands(void)
|
||||||
COM_AddCommand("noclip", Command_CheatNoClip_f);
|
COM_AddCommand("noclip", Command_CheatNoClip_f);
|
||||||
COM_AddCommand("god", Command_CheatGod_f);
|
COM_AddCommand("god", Command_CheatGod_f);
|
||||||
COM_AddCommand("setrings", Command_Setrings_f);
|
COM_AddCommand("setrings", Command_Setrings_f);
|
||||||
|
COM_AddCommand("setspheres", Command_Setspheres_f);
|
||||||
COM_AddCommand("setlives", Command_Setlives_f);
|
COM_AddCommand("setlives", Command_Setlives_f);
|
||||||
COM_AddCommand("setscore", Command_Setscore_f);
|
COM_AddCommand("setscore", Command_Setscore_f);
|
||||||
COM_AddCommand("devmode", Command_Devmode_f);
|
COM_AddCommand("devmode", Command_Devmode_f);
|
||||||
|
|
@ -2094,6 +2095,10 @@ void D_Cheat(INT32 playernum, INT32 cheat, ...)
|
||||||
case CHEAT_RESPAWNAT:
|
case CHEAT_RESPAWNAT:
|
||||||
COPY(WRITEINT32, INT32);
|
COPY(WRITEINT32, INT32);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CHEAT_SPHERES:
|
||||||
|
COPY(WRITEINT16, int);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef COPY
|
#undef COPY
|
||||||
|
|
@ -6242,6 +6247,17 @@ static void Got_Cheat(UINT8 **cp, INT32 playernum)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case CHEAT_SPHERES: {
|
||||||
|
INT16 spheres = READINT16(*cp);
|
||||||
|
|
||||||
|
// P_GivePlayerSpheres does value clamping
|
||||||
|
player->spheres = 0;
|
||||||
|
P_GivePlayerSpheres(player, spheres);
|
||||||
|
|
||||||
|
CV_CheaterWarning(targetPlayer, va("spheres = %d", spheres));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case NUMBER_OF_CHEATS:
|
case NUMBER_OF_CHEATS:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -560,6 +560,14 @@ void Command_Setrings_f(void)
|
||||||
D_Cheat(consoleplayer, CHEAT_RINGS, atoi(COM_Argv(1)));
|
D_Cheat(consoleplayer, CHEAT_RINGS, atoi(COM_Argv(1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Command_Setspheres_f(void)
|
||||||
|
{
|
||||||
|
REQUIRE_CHEATS;
|
||||||
|
REQUIRE_INLEVEL;
|
||||||
|
|
||||||
|
D_Cheat(consoleplayer, CHEAT_SPHERES, atoi(COM_Argv(1)));
|
||||||
|
}
|
||||||
|
|
||||||
void Command_Setlives_f(void)
|
void Command_Setlives_f(void)
|
||||||
{
|
{
|
||||||
REQUIRE_CHEATS;
|
REQUIRE_CHEATS;
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,7 @@ typedef enum {
|
||||||
CHEAT_ANGLE,
|
CHEAT_ANGLE,
|
||||||
CHEAT_RESPAWNAT,
|
CHEAT_RESPAWNAT,
|
||||||
CHEAT_GIVEPOWERUP,
|
CHEAT_GIVEPOWERUP,
|
||||||
|
CHEAT_SPHERES,
|
||||||
|
|
||||||
NUMBER_OF_CHEATS
|
NUMBER_OF_CHEATS
|
||||||
} cheat_t;
|
} cheat_t;
|
||||||
|
|
@ -75,6 +76,7 @@ void Command_CheatNoClip_f(void);
|
||||||
void Command_CheatGod_f(void);
|
void Command_CheatGod_f(void);
|
||||||
void Command_Savecheckpoint_f(void);
|
void Command_Savecheckpoint_f(void);
|
||||||
void Command_Setrings_f(void);
|
void Command_Setrings_f(void);
|
||||||
|
void Command_Setspheres_f(void);
|
||||||
void Command_Setlives_f(void);
|
void Command_Setlives_f(void);
|
||||||
void Command_Setscore_f(void);
|
void Command_Setscore_f(void);
|
||||||
void Command_Devmode_f(void);
|
void Command_Devmode_f(void);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue