|
|
|
@ -1529,6 +1529,8 @@ void GlobalMenu::VoteMenu( CBasePlayer *pPlayer )
@@ -1529,6 +1529,8 @@ void GlobalMenu::VoteMenu( CBasePlayer *pPlayer )
|
|
|
|
|
ShowGlobalMenu(UTIL_VarArgs("%s requested to force change map", UTIL_CoopPlayerName( pPlayer ) ), i, maps); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UTIL_CoopValidateOffset( void ) |
|
|
|
|
{ |
|
|
|
|
if( !g_SavedCoords.validoffset) |
|
|
|
@ -1676,7 +1678,8 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
@@ -1676,7 +1678,8 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
|
|
|
|
|
{ |
|
|
|
|
if( !count2 ) |
|
|
|
|
{ |
|
|
|
|
if( pActivator && pActivator->IsPlayer() && m_flRepeatTimer - gpGlobals->time < -1 ){ |
|
|
|
|
if( pActivator && pActivator->IsPlayer() && m_flRepeatTimer - gpGlobals->time < -1 ) |
|
|
|
|
{ |
|
|
|
|
CBasePlayer *pPlayer = (CBasePlayer*)pActivator; |
|
|
|
|
MESSAGE_BEGIN( MSG_ALL, 8, NULL ); // svc_print
|
|
|
|
|
WRITE_BYTE( 3 ); // PRINT_CHAT
|
|
|
|
@ -1815,24 +1818,12 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
@@ -1815,24 +1818,12 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
|
|
|
|
|
ALERT( at_console, "Player isn't in the transition volume %s, aborting\n", m_szLandmarkName ); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
//else
|
|
|
|
|
/* if !pPlayer
|
|
|
|
|
{ |
|
|
|
|
ALERT( at_console, ", aborting\n" ); |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
MESSAGE_BEGIN( MSG_ALL, 8, NULL ); // svc_print
|
|
|
|
|
WRITE_BYTE( 3 ); // PRINT_CHAT
|
|
|
|
|
WRITE_STRING( UTIL_VarArgs( "%s^7 activated changelevel\n", ( pPlayer->pev->netname && STRING( pPlayer->pev->netname )[0] != 0 ) ? STRING( pPlayer->pev->netname ) : "unconnected")); |
|
|
|
|
MESSAGE_END(); |
|
|
|
|
|
|
|
|
|
// shedule remove ke^w on first info_player_start
|
|
|
|
|
/*edict_t *playerstart = FIND_ENTITY_BY_CLASSNAME( NULL, "info_player_start" );
|
|
|
|
|
if( !FNullEnt(playerstart) ) |
|
|
|
|
playerstart->v.flags |= FL_KILLME;*/ |
|
|
|
|
|
|
|
|
|
// This object will get removed in the call to CHANGE_LEVEL, copy the params into "safe" memory
|
|
|
|
|
strcpy( st_szNextMap, m_szMapName ); |
|
|
|
|
|
|
|
|
@ -1879,29 +1870,23 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
@@ -1879,29 +1870,23 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
|
|
|
|
|
{ |
|
|
|
|
CBasePlayer *plr = (CBasePlayer*)UTIL_PlayerByIndex( i ); |
|
|
|
|
|
|
|
|
|
// reset all players state
|
|
|
|
|
// reset all players state to make it spawn again after restart
|
|
|
|
|
if( plr ) |
|
|
|
|
{ |
|
|
|
|
plr->m_state = STATE_UNINITIALIZED; |
|
|
|
|
plr->RemoveAllItems( TRUE ); |
|
|
|
|
UTIL_BecomeSpectator( plr ); |
|
|
|
|
//plr->SetThink( &CBasePlayer::Spawn );
|
|
|
|
|
//plr->pev->nextthink = gpGlobals->time + 1;
|
|
|
|
|
// HACK: force perform reconnection
|
|
|
|
|
if( mp_coop_reconnect_hack.value ) |
|
|
|
|
CLIENT_COMMAND( plr->edict(), "reconnect\n" ); |
|
|
|
|
|
|
|
|
|
//CLIENT_COMMAND( plr->edict(), "alias cmd \"reconnect;unalias cmd\"\n" );
|
|
|
|
|
//MESSAGE_BEGIN( MSG_ONE, 2, NULL, plr->pev ); // svc_disconnect after stufftext
|
|
|
|
|
//MESSAGE_END();
|
|
|
|
|
//SERVER_COMMAND( UTIL_VarArgs( "kick %d\n", i-1 ) );
|
|
|
|
|
//SERVER_EXECUTE();
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
g_fPause = true; |
|
|
|
|
} |
|
|
|
|
s_SavedCoords.fUsed = m_bUsed; |
|
|
|
|
s_SavedCoords.valid = valid; |
|
|
|
|
|
|
|
|
|
// wait 5 frames to make sure all players are in reconnected state
|
|
|
|
|
if( mp_coop_reconnect_hack.value ) |
|
|
|
|
SERVER_COMMAND( UTIL_VarArgs( "wait;wait;wait;wait;wait;changelevel %s %s\n", st_szNextMap, st_szNextSpot ) ); |
|
|
|
|
else |
|
|
|
|