Add GTR_CHECKPOINTS

- Prevents Checkpoint from spawning
- Prevents spawnpoint-handling code from occouring
This commit is contained in:
toaster 2023-09-16 23:22:59 +01:00
parent 2bbf69ded3
commit 467b5f831b
4 changed files with 26 additions and 19 deletions

View file

@ -5986,6 +5986,7 @@ const char *const GAMETYPERULE_LIST[] = {
"KARMA",
"ITEMARROWS",
"CHECKPOINTS",
"PRISONS",
"CATCHER",
"ROLLINGSTART",

View file

@ -622,25 +622,26 @@ enum GameTypeRules
GTR_ITEMARROWS = 1<<9, // Show item box arrows above players
// Bonus gametype rules
GTR_PRISONS = 1<<10, // Can enter Prison Break mode
GTR_CATCHER = 1<<11, // UFO Catcher (only works with GTR_CIRCUIT)
GTR_ROLLINGSTART = 1<<12, // Rolling start (only works with GTR_CIRCUIT)
GTR_SPECIALSTART = 1<<13, // White fade instant start
GTR_BOSS = 1<<14, // Boss intro and spawning
GTR_CHECKPOINTS = 1<<10, // Player respawns at specific checkpoints
GTR_PRISONS = 1<<11, // Can enter Prison Break mode
GTR_CATCHER = 1<<12, // UFO Catcher (only works with GTR_CIRCUIT)
GTR_ROLLINGSTART = 1<<13, // Rolling start (only works with GTR_CIRCUIT)
GTR_SPECIALSTART = 1<<14, // White fade instant start
GTR_BOSS = 1<<15, // Boss intro and spawning
// General purpose rules
GTR_POINTLIMIT = 1<<15, // Reaching point limit ends the round
GTR_TIMELIMIT = 1<<16, // Reaching time limit ends the round
GTR_OVERTIME = 1<<17, // Allow overtime behavior
GTR_ENCORE = 1<<18, // Alternate Encore mirroring, scripting, and texture remapping
GTR_POINTLIMIT = 1<<16, // Reaching point limit ends the round
GTR_TIMELIMIT = 1<<17, // Reaching time limit ends the round
GTR_OVERTIME = 1<<18, // Allow overtime behavior
GTR_ENCORE = 1<<19, // Alternate Encore mirroring, scripting, and texture remapping
GTR_TEAMS = 1<<19, // Teams are forced on
GTR_NOTEAMS = 1<<20, // Teams are forced off
GTR_TEAMSTARTS = 1<<21, // Use team-based start positions
GTR_TEAMS = 1<<20, // Teams are forced on
GTR_NOTEAMS = 1<<21, // Teams are forced off
GTR_TEAMSTARTS = 1<<22, // Use team-based start positions
GTR_NOMP = 1<<22, // No multiplayer
GTR_NOCUPSELECT = 1<<23, // Your maps are not selected via cup.
GTR_NOPOSITION = 1<<24, // No POSITION
GTR_NOMP = 1<<23, // No multiplayer
GTR_NOCUPSELECT = 1<<24, // Your maps are not selected via cup.
GTR_NOPOSITION = 1<<25, // No POSITION
// free: to and including 1<<31
};

View file

@ -2469,9 +2469,10 @@ void G_MovePlayerToSpawnOrCheatcheck(INT32 playernum)
mobj_t *checkpoint;
vector3_t pos;
if (players[playernum].checkpointId &&
(checkpoint = Obj_FindCheckpoint(players[playernum].checkpointId)) &&
Obj_GetCheckpointRespawnPosition(checkpoint, &pos))
if ((gametyperules & GTR_CHECKPOINTS)
&& players[playernum].checkpointId
&& (checkpoint = Obj_FindCheckpoint(players[playernum].checkpointId))
&& Obj_GetCheckpointRespawnPosition(checkpoint, &pos))
{
respawnvars_t *rsp = &players[playernum].respawn;
@ -3057,7 +3058,7 @@ static gametype_t defaultgametypes[] =
{
"Tutorial",
"GT_TUTORIAL",
GTR_NOMP|GTR_NOCUPSELECT|GTR_NOPOSITION,
GTR_CHECKPOINTS|GTR_NOMP|GTR_NOCUPSELECT|GTR_NOPOSITION,
TOL_TUTORIAL,
int_none,
0,

View file

@ -12318,6 +12318,10 @@ static boolean P_AllowMobjSpawn(mapthing_t* mthing, mobjtype_t i)
if (modeattacking & ATTACKING_SPB)
return false;
break;
case MT_CHECKPOINT_END:
if (!(gametyperules & GTR_CHECKPOINTS))
return false;
break;
default:
break;
}