Merge branch 'sphere-ring-concurrence' into 'master'

Change SETSPHERES console command to SETRINGS to handle player->spheres transparently

See merge request STJr/SRB2Internal!167
This commit is contained in:
Digiku 2018-08-29 04:24:23 -04:00
commit 78c78d9e63
3 changed files with 12 additions and 23 deletions

View File

@ -823,7 +823,6 @@ void D_RegisterClientCommands(void)
COM_AddCommand("getallemeralds", Command_Getallemeralds_f);
COM_AddCommand("resetemeralds", Command_Resetemeralds_f);
COM_AddCommand("setrings", Command_Setrings_f);
COM_AddCommand("setspheres", Command_Setspheres_f);
COM_AddCommand("setlives", Command_Setlives_f);
COM_AddCommand("setcontinues", Command_Setcontinues_f);
COM_AddCommand("devmode", Command_Devmode_f);

View File

@ -880,28 +880,19 @@ void Command_Setrings_f(void)
if (COM_Argc() > 1)
{
// P_GivePlayerRings does value clamping
players[consoleplayer].rings = 0;
P_GivePlayerRings(&players[consoleplayer], atoi(COM_Argv(1)));
if (!G_IsSpecialStage(gamemap) || !(maptol & TOL_NIGHTS))
if (!(maptol & TOL_NIGHTS))
{
// P_GivePlayerRings does value clamping
players[consoleplayer].rings = 0;
P_GivePlayerRings(&players[consoleplayer], atoi(COM_Argv(1)));
players[consoleplayer].totalring -= atoi(COM_Argv(1)); //undo totalring addition done in P_GivePlayerRings
G_SetGameModified(multiplayer);
}
}
void Command_Setspheres_f(void)
{
REQUIRE_INLEVEL;
REQUIRE_SINGLEPLAYER;
REQUIRE_NOULTIMATE;
REQUIRE_PANDORA;
if (COM_Argc() > 1)
{
// P_GivePlayerRings does value clamping
players[consoleplayer].spheres = 0;
P_GivePlayerSpheres(&players[consoleplayer], atoi(COM_Argv(1)));
}
else
{
players[consoleplayer].spheres = 0;
P_GivePlayerSpheres(&player[consoleplayer], atoi(COM_Argv(1)));
// no totalsphere addition to revert
}
G_SetGameModified(multiplayer);
}

View File

@ -51,7 +51,6 @@ void Command_Savecheckpoint_f(void);
void Command_Getallemeralds_f(void);
void Command_Resetemeralds_f(void);
void Command_Setrings_f(void);
void Command_Setspheres_f(void);
void Command_Setlives_f(void);
void Command_Setcontinues_f(void);
void Command_Devmode_f(void);