diff --git a/src/deh_tables.c b/src/deh_tables.c index f9da162ac..f4112f614 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -5986,6 +5986,7 @@ const char *const GAMETYPERULE_LIST[] = { "KARMA", "ITEMARROWS", + "CHECKPOINTS", "PRISONS", "CATCHER", "ROLLINGSTART", diff --git a/src/doomstat.h b/src/doomstat.h index 7b519819a..3dd1eb1a4 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -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 }; diff --git a/src/g_game.c b/src/g_game.c index 56ad5149b..4769c8b8b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -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, diff --git a/src/p_mobj.c b/src/p_mobj.c index 767060313..f03b61df5 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -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; }