Fixed some stuff for the background maps. The ff_sv_client and ff_sv_player code is a complete mess! If you use -allowdebug or -console in your startup line the background maps don't load, not sure where in the code this is set.

This commit is contained in:
hlstriker 2013-11-23 18:58:39 +00:00 committed by squeek
parent 6f2933135b
commit b2240d15dc
2 changed files with 21 additions and 12 deletions

View file

@ -41,8 +41,14 @@ extern bool g_fGameOver;
void FinishClientPutInServer( CFF_SV_Player *pPlayer )
{
pPlayer->InitialSpawn();
pPlayer->Spawn();
pPlayer->PickDefaultSpawnTeam();
//pPlayer->Spawn(); // PickDefaultSpawnTeam() will call Spawn()
if( gpGlobals->eLoadType == MapLoad_Background )
{
pPlayer->m_Local.m_iHideHUD = HIDEHUD_ALL;
return;
}
char sName[128];
Q_strncpy( sName, pPlayer->GetPlayerName(), sizeof( sName ) );

View file

@ -248,12 +248,16 @@ void CFF_SV_Player::GiveDefaultItems( void )
void CFF_SV_Player::PickDefaultSpawnTeam( void )
{
m_flNextModelChangeTime = 0.0f;
m_flNextTeamChangeTime = 0.0f;
if ( GetTeamNumber() != FF_TEAM_UNASSIGNED )
return;
// FF TODO: remove once team hud is in / or auto assign
// temp hack assumes FF_TEAM_ONE is present
ChangeTeam ( FF_TEAM_ONE );
if( gpGlobals->eLoadType == MapLoad_Background )
ChangeTeam( FF_TEAM_UNASSIGNED );
else
ChangeTeam( FF_TEAM_UNASSIGNED );
}
//-----------------------------------------------------------------------------
@ -261,14 +265,9 @@ void CFF_SV_Player::PickDefaultSpawnTeam( void )
//-----------------------------------------------------------------------------
void CFF_SV_Player::Spawn(void)
{
m_flNextModelChangeTime = 0.0f;
m_flNextTeamChangeTime = 0.0f;
PickDefaultSpawnTeam();
BaseClass::Spawn();
if ( !IsObserver() )
if ( !IsObserver() && gpGlobals->eLoadType != MapLoad_Background )
{
pl.deadflag = false;
RemoveSolidFlags( FSOLID_NOT_SOLID );
@ -883,6 +882,10 @@ void CFF_SV_Player::ChangeTeam( int iTeam )
{
CommitSuicide();
}
else
{
Spawn();
}
}
bool CFF_SV_Player::ClientCommand( const CCommand &args )
@ -1510,7 +1513,7 @@ void CFF_SV_Player::PostChangeTeam( int iOldTeam, int iNewTeam )
// reset state
// spawn called
if ( iOldTeam == TEAM_SPECTATOR )
if ( iOldTeam == FF_TEAM_SPECTATE )
{
StopObserverMode( );
}