2
0
mirror of https://github.com/FWGS/hlsdk-xash3d synced 2024-11-10 20:29:35 +01:00

Add mp_coop_reconnect_hack cvar

This commit is contained in:
mittorn 2016-10-19 12:22:43 +00:00
parent 237bf1ea73
commit 18976a4c58
3 changed files with 9 additions and 3 deletions

View File

@ -54,6 +54,7 @@ cvar_t mp_coop = { "mp_coop", "0", FCVAR_SERVER };
cvar_t mp_coop_changelevel = { "mp_coop_changelevel", "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_nofriendlyfire = { "mp_coop_nofriendlyfire", "0", FCVAR_SERVER };
cvar_t mp_coop_disabledmap = { "mp_coop_disabledmap", "", 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_unduck = { "mp_unduck", "0", FCVAR_SERVER }; cvar_t mp_unduck = { "mp_unduck", "0", FCVAR_SERVER };
cvar_t mp_semclip = { "mp_semclip", "0", FCVAR_SERVER }; cvar_t mp_semclip = { "mp_semclip", "0", FCVAR_SERVER };
@ -504,6 +505,7 @@ void GameDLLInit( void )
CVAR_REGISTER( &mp_coop_disabledmap ); CVAR_REGISTER( &mp_coop_disabledmap );
CVAR_REGISTER( &mp_unduck ); CVAR_REGISTER( &mp_unduck );
CVAR_REGISTER( &mp_semclip ); CVAR_REGISTER( &mp_semclip );
CVAR_REGISTER( &mp_coop_reconnect_hack );
CVAR_REGISTER( &mp_chattime ); CVAR_REGISTER( &mp_chattime );

View File

@ -54,6 +54,7 @@ extern cvar_t mp_coop_nofriendlyfire;
extern cvar_t mp_coop_disabledmap; extern cvar_t mp_coop_disabledmap;
extern cvar_t mp_unduck; extern cvar_t mp_unduck;
extern cvar_t mp_semclip; extern cvar_t mp_semclip;
extern cvar_t mp_coop_reconnect_hack;
extern bool g_fSavedDuck; extern bool g_fSavedDuck;
// Engine Cvars // Engine Cvars

View File

@ -2082,7 +2082,8 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
//plr->SetThink( &CBasePlayer::Spawn ); //plr->SetThink( &CBasePlayer::Spawn );
//plr->pev->nextthink = gpGlobals->time + 1; //plr->pev->nextthink = gpGlobals->time + 1;
// HACK: force perform reconnection // HACK: force perform reconnection
CLIENT_COMMAND( plr->edict(), "reconnect\n" ); if( mp_coop_reconnect_hack.value )
CLIENT_COMMAND( plr->edict(), "reconnect\n" );
//CLIENT_COMMAND( plr->edict(), "alias cmd \"reconnect;unalias cmd\"\n" ); //CLIENT_COMMAND( plr->edict(), "alias cmd \"reconnect;unalias cmd\"\n" );
//MESSAGE_BEGIN( MSG_ONE, 2, NULL, plr->pev ); // svc_disconnect after stufftext //MESSAGE_BEGIN( MSG_ONE, 2, NULL, plr->pev ); // svc_disconnect after stufftext
@ -2091,8 +2092,10 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
//SERVER_EXECUTE(); //SERVER_EXECUTE();
} }
} }
SERVER_COMMAND( UTIL_VarArgs( "wait;wait;wait;wait;wait;changelevel %s %s\n", st_szNextMap, st_szNextSpot ) ); if( mp_coop_reconnect_hack.value )
//CHANGE_LEVEL( st_szNextMap, st_szNextSpot ); SERVER_COMMAND( UTIL_VarArgs( "wait;wait;wait;wait;wait;changelevel %s %s\n", st_szNextMap, st_szNextSpot ) );
else
CHANGE_LEVEL( st_szNextMap, st_szNextSpot );
} }
// //