From 7474e073f85a1c96b1e2fea06ca1aa23791c4c88 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Thu, 16 Aug 2018 12:13:57 -0400 Subject: [PATCH] Change SETRINGS to support player->spheres in NiGHTS --- src/m_cheat.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/m_cheat.c b/src/m_cheat.c index 5ac742270..6e346de91 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -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); }