Change SETRINGS to support player->spheres in NiGHTS

This commit is contained in:
mazmazz 2018-08-16 12:13:57 -04:00
parent 03c4a626c3
commit 7474e073f8
1 changed files with 14 additions and 5 deletions

View File

@ -880,11 +880,20 @@ 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))
players[consoleplayer].totalring -= atoi(COM_Argv(1)); //undo totalring addition done in P_GivePlayerRings
if (!(maptol & TOL_NIGHTS))
{
// P_GivePlayerRings does value clamping
players[consoleplayer].rings = 0;
P_GivePlayerRings(&players[consoleplayer], atoi(COM_Argv(1)));
if (!G_IsSpecialStage(gamemap))
players[consoleplayer].totalring -= atoi(COM_Argv(1)); //undo totalring addition done in P_GivePlayerRings
}
else
{
players[consoleplayer].spheres = 0;
P_GivePlayerSpheres(&player[consoleplayer], atoi(COM_Argv(1)));
// no totalsphere addition to revert
}
G_SetGameModified(multiplayer);
}