Checkpoint (unfinished): player->totalsphere

This commit is contained in:
mazmazz 2018-08-16 12:14:41 -04:00
parent 32939a11f1
commit 4aade072ef
3 changed files with 7 additions and 1 deletions

View file

@ -2075,6 +2075,7 @@ void G_PlayerReborn(INT32 player)
INT32 exiting; INT32 exiting;
INT16 numboxes; INT16 numboxes;
INT16 totalring; INT16 totalring;
INT16 totalsphere;
UINT8 laps; UINT8 laps;
UINT8 mare; UINT8 mare;
UINT8 skincolor; UINT8 skincolor;
@ -2103,6 +2104,7 @@ void G_PlayerReborn(INT32 player)
numboxes = players[player].numboxes; numboxes = players[player].numboxes;
laps = players[player].laps; laps = players[player].laps;
totalring = players[player].totalring; totalring = players[player].totalring;
totalsphere = players[player].totalsphere;
skincolor = players[player].skincolor; skincolor = players[player].skincolor;
skin = players[player].skin; skin = players[player].skin;
@ -2187,6 +2189,7 @@ void G_PlayerReborn(INT32 player)
p->numboxes = numboxes; p->numboxes = numboxes;
p->laps = laps; p->laps = laps;
p->totalring = totalring; p->totalring = totalring;
p->totalsphere = totalsphere;
p->mare = mare; p->mare = mare;
if (bot) if (bot)

View file

@ -892,7 +892,8 @@ void Command_Setrings_f(void)
{ {
players[consoleplayer].spheres = 0; players[consoleplayer].spheres = 0;
P_GivePlayerSpheres(&player[consoleplayer], atoi(COM_Argv(1))); P_GivePlayerSpheres(&player[consoleplayer], atoi(COM_Argv(1)));
// no totalsphere addition to revert if (!G_IsSpecialStage(gamemap))
players[consoleplayer].totalsphere -= atoi(COM_Argv(1)); //undo totalsphere addition done in P_GivePlayerRings
} }
G_SetGameModified(multiplayer); G_SetGameModified(multiplayer);

View file

@ -963,6 +963,8 @@ void P_GivePlayerSpheres(player_t *player, INT32 num_spheres)
player->spheres += num_spheres; player->spheres += num_spheres;
player->totalsphere += num_spheres;
// Can only get up to 9999 spheres, sorry! // Can only get up to 9999 spheres, sorry!
if (player->spheres > 9999) if (player->spheres > 9999)
player->spheres = 9999; player->spheres = 9999;