Battle: add battlespawn cheat, spawn every player at the same spawnpoint

This commit is contained in:
James R 2024-01-06 00:21:53 -08:00
parent db0175a94d
commit 08dc00ea88
2 changed files with 14 additions and 3 deletions

View file

@ -789,6 +789,7 @@ consvar_t cv_votetime = UnsavedNetVar("votetime", "20").min_max(10, 3600);
//
consvar_t cv_barriertime = OnlineCheat("barriertime", "30").values(CV_Natural).description("How long it takes for the Barrier to shrink in Battle Overtime");
consvar_t cv_battlespawn = OnlineCheat("battlespawn", "0").values(CV_Unsigned).description("Spawn every player at the same spawnpoint in Battle (0 = random spawns)");
consvar_t cv_battletest = OnlineCheat("battletest", "Off").on_off().description("Free Play goes to Battle instead of Prisons");
#ifdef DEVELOP

View file

@ -2603,12 +2603,22 @@ mapthing_t *G_FindBattleStart(INT32 playernum)
if (numdmstarts)
{
for (j = 0; j < 64; j++)
extern consvar_t cv_battlespawn;
if (cv_battlespawn.value)
{
i = P_RandomKey(PR_PLAYERSTARTS, numdmstarts);
if (G_CheckSpot(playernum, deathmatchstarts[i]))
i = cv_battlespawn.value - 1;
if (i < numdmstarts)
return deathmatchstarts[i];
}
else
{
for (j = 0; j < 64; j++)
{
i = P_RandomKey(PR_PLAYERSTARTS, numdmstarts);
if (G_CheckSpot(playernum, deathmatchstarts[i]))
return deathmatchstarts[i];
}
}
if (doprints)
CONS_Alert(CONS_WARNING, M_GetText("Could not spawn at any Deathmatch starts!\n"));
return NULL;