Modified source engine (2017) developed by valve and leaked in 2020. Not for commercial purporses
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
902 B

5 years ago
//========= Copyright Valve Corporation, All rights reserved. ============//
//
//----------------------------------------------------------------------------------------
#include "cbase.h"
#include "playerspawncache.h"
//--------------------------------------------------------------------------------
/*static*/ CPlayerSpawnCache &CPlayerSpawnCache::Instance()
{
static CPlayerSpawnCache s_Instance;
return s_Instance;
}
CPlayerSpawnCache::CPlayerSpawnCache()
{
// Clear the cache
Reset();
// The only event we care about
ListenForGameEvent( "game_newmap" );
}
void CPlayerSpawnCache::Reset()
{
V_memset( &m_Data, 0, sizeof( m_Data ) );
}
void CPlayerSpawnCache::FireGameEvent( IGameEvent *pEvent )
{
// On new map, clear the cache
if ( FStrEq( pEvent->GetName(), "game_newmap" ) )
{
Reset();
}
}
//--------------------------------------------------------------------------------