Browse Source

Nullify pState when loading or changelevel

gravgun
mittorn 6 years ago
parent
commit
91e6494b67
  1. 3
      dlls/client.cpp
  2. 3
      dlls/coop.cpp
  3. 1
      dlls/multiplay_gamerules.cpp
  4. 1
      dlls/triggers.cpp

3
dlls/client.cpp

@ -691,7 +691,6 @@ void ClientUserInfoChanged( edict_t *pEntity, char *infobuffer )
const char *name = g_engfuncs.pfnInfoKeyValue( infobuffer, "name" ); const char *name = g_engfuncs.pfnInfoKeyValue( infobuffer, "name" );
// prevent keeping other's uid on saverestore // prevent keeping other's uid on saverestore
CBasePlayer *pPlayer = GetClassPtr((CBasePlayer *)&pEntity->v); CBasePlayer *pPlayer = GetClassPtr((CBasePlayer *)&pEntity->v);
const char *uid = GGM_GetAuthID( pPlayer ); const char *uid = GGM_GetAuthID( pPlayer );
@ -701,10 +700,10 @@ void ClientUserInfoChanged( edict_t *pEntity, char *infobuffer )
if( pState != pPlayer->m_ggm.pState ) if( pState != pPlayer->m_ggm.pState )
{ {
GGM_SaveState( pPlayer );
pEntity->v.netname = pEntity->v.frags = 0; pEntity->v.netname = pEntity->v.frags = 0;
if( pPlayer->m_ggm.iState == STATE_LOAD_FIX ) if( pPlayer->m_ggm.iState == STATE_LOAD_FIX )
return; return;
GGM_SaveState( pPlayer );
pPlayer->m_ggm.pState = pState; pPlayer->m_ggm.pState = pState;
pPlayer->m_ggm.iState = STATE_UNINITIALIZED; pPlayer->m_ggm.iState = STATE_UNINITIALIZED;
} }

3
dlls/coop.cpp

@ -518,7 +518,7 @@ void COOP_ServerActivate( void )
return; return;
} }
ALERT( at_console, "COOP_ServerActivate: %s", STRING( gpGlobals->mapname ) ); ALERT( at_console, "COOP_ServerActivate: %s\n", STRING( gpGlobals->mapname ) );
if( g_flDupCheck && gpGlobals->time && ( fabs( g_flDupCheck -gpGlobals->time ) < 1 || g_flDupCheck == 1 ) ) if( g_flDupCheck && gpGlobals->time && ( fabs( g_flDupCheck -gpGlobals->time ) < 1 || g_flDupCheck == 1 ) )
{ {
@ -565,6 +565,7 @@ void COOP_ServerActivate( void )
plr->m_ggm.iState = STATE_UNINITIALIZED; plr->m_ggm.iState = STATE_UNINITIALIZED;
plr->m_ggm.pState = NULL;
plr->RemoveAllItems( TRUE ); plr->RemoveAllItems( TRUE );
UTIL_BecomeSpectator( plr ); UTIL_BecomeSpectator( plr );
if( g_CoopState.landmarkTransition.fLoading ) if( g_CoopState.landmarkTransition.fLoading )

1
dlls/multiplay_gamerules.cpp

@ -568,6 +568,7 @@ void CHalfLifeMultiplay::PlayerThink( CBasePlayer *pPlayer )
{ {
CLIENT_COMMAND( pPlayer->edict(), "reconnect\n" ); CLIENT_COMMAND( pPlayer->edict(), "reconnect\n" );
pPlayer->m_ggm.iState = STATE_UNINITIALIZED; pPlayer->m_ggm.iState = STATE_UNINITIALIZED;
pPlayer->m_ggm.pState = NULL;
pPlayer->m_afButtonPressed = 0; pPlayer->m_afButtonPressed = 0;
return; return;
} }

1
dlls/triggers.cpp

@ -1803,6 +1803,7 @@ void CChangeLevel::ChangeLevelNow( CBaseEntity *pActivator )
{ {
GGM_SaveState( plr ); GGM_SaveState( plr );
plr->m_ggm.iState = STATE_UNINITIALIZED; plr->m_ggm.iState = STATE_UNINITIALIZED;
plr->m_ggm.pState = NULL;
plr->RemoveAllItems( TRUE ); plr->RemoveAllItems( TRUE );
UTIL_BecomeSpectator( plr ); UTIL_BecomeSpectator( plr );
// HACK: force perform reconnection // HACK: force perform reconnection

Loading…
Cancel
Save