Skip to content
Permalink
Browse files

game: fixed taken objectives disappear when shuffling with no restart

  • Loading branch information
rmarquis committed Dec 2, 2019
1 parent 131fa12 commit e44080a5e8ca98fbc32b54a865e1a72727fdc34e
Showing with 36 additions and 0 deletions.
  1. +36 −0 src/game/g_svcmds.c
@@ -892,11 +892,28 @@ void Svcmd_SwapTeams_f(void)
*/
void Svcmd_ShuffleTeamsXP_f(qboolean restart)
{
int i;
gentity_t *ent;

if (restart)
{
G_resetRoundState();
}

// ensure objectives are dropped with no restart
if (!restart)
{
for (i = 0; i < level.numConnectedClients; i++)
{
ent = g_entities + level.sortedClients[i];

if (ent->client->ps.powerups[PW_BLUEFLAG] || ent->client->ps.powerups[PW_REDFLAG])
{
G_DropItems(ent);
}
}
}

G_shuffleTeamsXP();

if ((g_gamestate.integer == GS_INITIALIZE) ||
@@ -905,6 +922,7 @@ void Svcmd_ShuffleTeamsXP_f(qboolean restart)
{
return;
}

if (restart)
{
G_resetModeState();
@@ -935,11 +953,28 @@ void Svcmd_ShuffleTeamsXPNoRestart(void)
*/
void Svcmd_ShuffleTeamsSR_f(qboolean restart)
{
int i;
gentity_t *ent;

if (restart)
{
G_resetRoundState();
}

// ensure objectives are dropped with no restart
if (!restart)
{
for (i = 0; i < level.numConnectedClients; i++)
{
ent = g_entities + level.sortedClients[i];

if (ent->client->ps.powerups[PW_BLUEFLAG] || ent->client->ps.powerups[PW_REDFLAG])
{
G_DropItems(ent);
}
}
}

G_shuffleTeamsSR();

if ((g_gamestate.integer == GS_INITIALIZE) ||
@@ -948,6 +983,7 @@ void Svcmd_ShuffleTeamsSR_f(qboolean restart)
{
return;
}

if (restart)
{
G_resetModeState();

0 comments on commit e44080a

Please sign in to comment.
You can’t perform that action at this time.