Get rid of mp_coop_changelevel, merge with mp_coop

This commit is contained in:
mittorn 2018-10-21 15:26:40 +07:00
parent 7286f61fd9
commit ecb31d4533
10 changed files with 12 additions and 23 deletions

View File

@ -282,7 +282,7 @@ void DispatchSave( edict_t *pent, SAVERESTOREDATA *pSaveData )
if( pEntity->ObjectCaps() & FCAP_DONT_SAVE )
return;
if( mp_coop_changelevel.value && pent->v.movetype == MOVETYPE_FOLLOW )
if( mp_coop.value && pent->v.movetype == MOVETYPE_FOLLOW )
{
// players will not be saved, it's items too
if( ENTINDEX( pent->v.aiment ) > 0 && ENTINDEX( pent->v.aiment ) <= gpGlobals->maxClients )

View File

@ -870,7 +870,7 @@ void ParmsNewLevel( void )
pSaveData->connectionCount = BuildChangeList( pSaveData->levelList, MAX_LEVEL_CONNECTIONS );
}
else
if( mp_coop_changelevel.value )
if( mp_coop.value )
{
COOP_ClearData();
g_WeaponList.Clear();
@ -889,7 +889,7 @@ void ParmsChangeLevel( void )
pSaveData->connectionCount = BuildChangeList( pSaveData->levelList, MAX_LEVEL_CONNECTIONS );
}
else
if( mp_coop_changelevel.value )
if( mp_coop.value )
{
COOP_ClearData();
g_WeaponList.Clear();

View File

@ -11,9 +11,7 @@ struct SavedCoords g_SavedCoords, s_SavedCoords;
static float msglimittime1, msglimittime2;
cvar_t mp_coop = { "mp_coop", "0", FCVAR_SERVER };
cvar_t mp_coop_changelevel = { "mp_coop_changelevel", "0", FCVAR_SERVER };
cvar_t mp_coop_nofriendlyfire = { "mp_coop_nofriendlyfire", "0", FCVAR_SERVER };
cvar_t mp_coop_disabledmap = { "mp_coop_disabledmap", "", FCVAR_SERVER };
cvar_t mp_coop_reconnect_hack = { "mp_coop_reconnect_hack", "0", FCVAR_SERVER };
cvar_t mp_coop_noangry = { "mp_coop_noangry", "0", FCVAR_SERVER };
cvar_t mp_coop_checkpoints = { "mp_coop_checkpoints", "1", FCVAR_SERVER };
@ -936,9 +934,7 @@ bool COOP_ClientCommand( edict_t *pEntity )
void COOP_RegisterCVars()
{
CVAR_REGISTER( &mp_coop );
CVAR_REGISTER( &mp_coop_changelevel );
CVAR_REGISTER( &mp_coop_nofriendlyfire );
CVAR_REGISTER( &mp_coop_disabledmap );
CVAR_REGISTER( &mp_unduck );
CVAR_REGISTER( &mp_semclip );
CVAR_REGISTER( &mp_coop_reconnect_hack );

View File

@ -2,9 +2,7 @@
#define COOP_UTIL_H
extern cvar_t mp_gravgun_players;
extern cvar_t mp_coop;
extern cvar_t mp_coop_changelevel;
extern cvar_t mp_coop_nofriendlyfire;
extern cvar_t mp_coop_disabledmap;
extern cvar_t mp_coop_checkpoints;
extern cvar_t mp_skipdefaults;
extern cvar_t mp_coop_strongcheckpoints;

View File

@ -88,7 +88,7 @@ edict_t *CGameRules::GetPlayerSpawnSpot( CBasePlayer *pPlayer )
pPlayer->pev->angles = VARS( pentSpawnSpot )->angles;
pPlayer->pev->punchangle = g_vecZero;
if( !(pPlayer->pev->flags & FL_SPECTATOR ) )
if( mp_coop_changelevel.value )
if( mp_coop.value )
if( !UTIL_CoopGetSpawnPoint( &pPlayer->pev->origin, &pPlayer->pev->angles ) )
{
if( !g_pLastSpawn )

View File

@ -1044,7 +1044,7 @@ bool GGM_PlayerSpawn( CBasePlayer *pPlayer )
return true;
}
if( mp_coop_changelevel.value && pPlayer->gravgunmod_data.m_state == STATE_POINT_SELECT && !(pPlayer->pev->flags & FL_SPECTATOR) )
if( mp_coop.value && pPlayer->gravgunmod_data.m_state == STATE_POINT_SELECT && !(pPlayer->pev->flags & FL_SPECTATOR) )
{
pPlayer->RemoveAllItems( TRUE );
UTIL_BecomeSpectator( pPlayer );
@ -1054,7 +1054,7 @@ bool GGM_PlayerSpawn( CBasePlayer *pPlayer )
if( pPlayer->pev->flags & FL_SPECTATOR )
return true;
if( mp_coop_changelevel.value )
if( mp_coop.value )
{
if( pPlayer->gravgunmod_data.m_state != STATE_SPAWNED )
{

View File

@ -634,7 +634,7 @@ void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer )
if( (int)cvar_allow_gateofbabylon.value == 2 )
pPlayer->GiveNamedItem( "weapon_gateofbabylon" );
if( mp_coop_changelevel.value )
if( mp_coop.value )
{
// pPlayer->GiveNamedItem( "item_suit" );
g_WeaponList.GiveToPlayer(pPlayer);

View File

@ -764,7 +764,7 @@ void CFuncTrain::Next( void )
SetBits( pev->effects, EF_NOINTERP );
UTIL_SetOrigin( pev, pTarg->pev->origin - ( pev->mins + pev->maxs ) * 0.5 );
Wait(); // Get on with doing the next path corner.
if( mp_coop_changelevel.value )
if( mp_coop.value )
pev->iuser1++; // Invalidate state for coop
}
else

View File

@ -3117,7 +3117,7 @@ int CBasePlayer::Restore( CRestore &restore )
#endif
// restored player has some bugs untill respawned
if( mp_coop_changelevel.value )
if( mp_coop.value )
{
gravgunmod_data.m_state = STATE_CONNECTED;
SetThink( &CBasePlayer::Spawn );

View File

@ -1420,7 +1420,7 @@ void CChangeLevel::Spawn( void )
if( !( pev->spawnflags & SF_CHANGELEVEL_USEONLY ) )
{
SetTouch( &CChangeLevel::TouchChangeLevel );
if( mp_coop_changelevel.value )
if( mp_coop.value )
{
if( gpGlobals->startspot && STRING(gpGlobals->startspot) && !strcmp(STRING(gpGlobals->startspot), m_szLandmarkName) )
m_fIsBack = true;
@ -1550,11 +1550,6 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
if( s_SavedCoords.valid )
return; //already pending
if( !strcmp( m_szMapName, mp_coop_disabledmap.string ) )
{
ClientPrint( pActivator->pev, HUD_PRINTCENTER, "MAP %S IS DISABLED", m_szMapName );
return;
}
// forget touch by some fool
if( gpGlobals->time - pev->dmgtime > 30)
{
@ -1562,7 +1557,7 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
pev->nextthink = gpGlobals->time + 30;
}
if(mp_coop_changelevel.value)
if(mp_coop.value)
{
SavedCoords l_SavedCoords = {};
// if not activated by touch, do not count players
@ -1778,7 +1773,7 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
ALERT( at_console, "CHANGE LEVEL: %s %s\n", st_szNextMap, st_szNextSpot );
COOP_ResetVote();
// loop through all clients, reset state
if( mp_coop_changelevel.value )
if( mp_coop.value )
{
for( int i = 1; i <= gpGlobals->maxClients; i++ )
{