- add 'sv_alwaystally' defaults to 0 with the following states:

* 0: previous behavior (completely MAPINFO controlled)
* 1: always show level tally at the end of an episode
* 2: always show level tally even when changing levels within a hub

# Conflicts:
#	src/g_level.cpp
#	src/g_levellocals.h

# Conflicts:
#	src/g_level.cpp
This commit is contained in:
Rachael Alexanderson 2020-07-21 13:53:27 -04:00 committed by drfrag
parent b9e2063a65
commit b9e98889ef
2 changed files with 25 additions and 4 deletions

View file

@ -118,6 +118,8 @@ EXTERN_CVAR (String, playerclass)
#define RCLS_ID MAKE_ID('r','c','L','s')
#define PCLS_ID MAKE_ID('p','c','L','s')
CVAR(Int, sv_alwaystally, 0, CVAR_ARCHIVE | CVAR_SERVERINFO)
void G_VerifySkill();
@ -545,6 +547,26 @@ static bool unloading;
EXTERN_CVAR(Bool, sv_singleplayerrespawn)
bool ShouldDoIntermission(cluster_info_t* nextcluster, cluster_info_t* thiscluster)
{
// this is here to remove some code duplication
if ((sv_alwaystally == 2) || (deathmatch))
return true;
if ((sv_alwaystally == 0) && (level.flags & LEVEL_NOINTERMISSION))
return false;
bool withinSameCluster = (nextcluster == thiscluster);
bool clusterIsHub = (thiscluster->flags & CLUSTER_HUB);
bool hubNoIntermission = !(thiscluster->flags & CLUSTER_ALLOWINTERMISSION);
if (withinSameCluster && clusterIsHub && hubNoIntermission)
return false;
return true;
}
void G_ChangeLevel(const char *levelname, int position, int flags, int nextSkill)
{
level_info_t *nextinfo = NULL;
@ -641,7 +663,7 @@ void G_ChangeLevel(const char *levelname, int position, int flags, int nextSkill
if (thiscluster && (thiscluster->flags & CLUSTER_HUB))
{
if ((level.flags & LEVEL_NOINTERMISSION) || ((nextcluster == thiscluster) && !(thiscluster->flags & CLUSTER_ALLOWINTERMISSION)))
if (!ShouldDoIntermission(nextcluster, thiscluster))
NoWipe = 35;
D_DrawIcon = "TELEICON";
}
@ -892,9 +914,7 @@ void G_DoCompleted (void)
finishstate = mode;
if (!deathmatch &&
((level.flags & LEVEL_NOINTERMISSION) ||
((nextcluster == thiscluster) && (thiscluster->flags & CLUSTER_HUB) && !(thiscluster->flags & CLUSTER_ALLOWINTERMISSION))))
if (!ShouldDoIntermission(nextcluster, thiscluster))
{
G_WorldDone ();
return;

View file

@ -529,6 +529,7 @@ void G_WriteSnapshots (TArray<FString> &, TArray<FCompressedBuffer> &);
void G_WriteVisited(FSerializer &arc);
void G_ReadVisited(FSerializer &arc);
void G_ClearHubInfo();
bool ShouldDoIntermission(cluster_info_t* nextcluster, cluster_info_t* thiscluster);
enum ESkillProperty
{