Browse Source

Add mp_coop_reconnect_hack cvar

hlzbot-dirty
mittorn 8 years ago
parent
commit
18976a4c58
  1. 2
      dlls/game.cpp
  2. 1
      dlls/game.h
  3. 5
      dlls/triggers.cpp

2
dlls/game.cpp

@ -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 );

1
dlls/game.h

@ -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

5
dlls/triggers.cpp

@ -2082,6 +2082,7 @@ 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
if( mp_coop_reconnect_hack.value )
CLIENT_COMMAND( plr->edict(), "reconnect\n" ); 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" );
@ -2091,8 +2092,10 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
//SERVER_EXECUTE(); //SERVER_EXECUTE();
} }
} }
if( mp_coop_reconnect_hack.value )
SERVER_COMMAND( UTIL_VarArgs( "wait;wait;wait;wait;wait;changelevel %s %s\n", st_szNextMap, st_szNextSpot ) ); SERVER_COMMAND( UTIL_VarArgs( "wait;wait;wait;wait;wait;changelevel %s %s\n", st_szNextMap, st_szNextSpot ) );
//CHANGE_LEVEL( st_szNextMap, st_szNextSpot ); else
CHANGE_LEVEL( st_szNextMap, st_szNextSpot );
} }
// //

Loading…
Cancel
Save