mirror of
https://github.com/fortressforever/fortressforever-2013.git
synced 2025-02-15 16:41:19 +00:00
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:
parent
6f2933135b
commit
b2240d15dc
2 changed files with 21 additions and 12 deletions
|
@ -41,8 +41,14 @@ extern bool g_fGameOver;
|
||||||
void FinishClientPutInServer( CFF_SV_Player *pPlayer )
|
void FinishClientPutInServer( CFF_SV_Player *pPlayer )
|
||||||
{
|
{
|
||||||
pPlayer->InitialSpawn();
|
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];
|
char sName[128];
|
||||||
Q_strncpy( sName, pPlayer->GetPlayerName(), sizeof( sName ) );
|
Q_strncpy( sName, pPlayer->GetPlayerName(), sizeof( sName ) );
|
||||||
|
|
|
@ -248,12 +248,16 @@ void CFF_SV_Player::GiveDefaultItems( void )
|
||||||
|
|
||||||
void CFF_SV_Player::PickDefaultSpawnTeam( void )
|
void CFF_SV_Player::PickDefaultSpawnTeam( void )
|
||||||
{
|
{
|
||||||
|
m_flNextModelChangeTime = 0.0f;
|
||||||
|
m_flNextTeamChangeTime = 0.0f;
|
||||||
|
|
||||||
if ( GetTeamNumber() != FF_TEAM_UNASSIGNED )
|
if ( GetTeamNumber() != FF_TEAM_UNASSIGNED )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// FF TODO: remove once team hud is in / or auto assign
|
if( gpGlobals->eLoadType == MapLoad_Background )
|
||||||
// temp hack assumes FF_TEAM_ONE is present
|
ChangeTeam( FF_TEAM_UNASSIGNED );
|
||||||
ChangeTeam ( FF_TEAM_ONE );
|
else
|
||||||
|
ChangeTeam( FF_TEAM_UNASSIGNED );
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -261,14 +265,9 @@ void CFF_SV_Player::PickDefaultSpawnTeam( void )
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void CFF_SV_Player::Spawn(void)
|
void CFF_SV_Player::Spawn(void)
|
||||||
{
|
{
|
||||||
m_flNextModelChangeTime = 0.0f;
|
|
||||||
m_flNextTeamChangeTime = 0.0f;
|
|
||||||
|
|
||||||
PickDefaultSpawnTeam();
|
|
||||||
|
|
||||||
BaseClass::Spawn();
|
BaseClass::Spawn();
|
||||||
|
|
||||||
if ( !IsObserver() )
|
if ( !IsObserver() && gpGlobals->eLoadType != MapLoad_Background )
|
||||||
{
|
{
|
||||||
pl.deadflag = false;
|
pl.deadflag = false;
|
||||||
RemoveSolidFlags( FSOLID_NOT_SOLID );
|
RemoveSolidFlags( FSOLID_NOT_SOLID );
|
||||||
|
@ -883,6 +882,10 @@ void CFF_SV_Player::ChangeTeam( int iTeam )
|
||||||
{
|
{
|
||||||
CommitSuicide();
|
CommitSuicide();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Spawn();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CFF_SV_Player::ClientCommand( const CCommand &args )
|
bool CFF_SV_Player::ClientCommand( const CCommand &args )
|
||||||
|
@ -1510,7 +1513,7 @@ void CFF_SV_Player::PostChangeTeam( int iOldTeam, int iNewTeam )
|
||||||
// reset state
|
// reset state
|
||||||
// spawn called
|
// spawn called
|
||||||
|
|
||||||
if ( iOldTeam == TEAM_SPECTATOR )
|
if ( iOldTeam == FF_TEAM_SPECTATE )
|
||||||
{
|
{
|
||||||
StopObserverMode( );
|
StopObserverMode( );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue