mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-02-09 05:24:17 +00:00
Observer seems to be complete broken, restore old mode
This commit is contained in:
parent
8837e7e188
commit
48201dfcc3
@ -603,10 +603,10 @@ void ClientCommand( edict_t *pEntity )
|
||||
else if( FStrEq( pcmd, "spectate" ) ) // clients wants to become a spectator
|
||||
{
|
||||
CBasePlayer *pPlayer = GetClassPtr( (CBasePlayer *)pev );
|
||||
if( !pPlayer->IsObserver() )
|
||||
/*if( !pPlayer->IsObserver() )
|
||||
{
|
||||
// always allow proxies to become a spectator
|
||||
if( ( pev->flags & FL_PROXY ) || allow_spectators.value )
|
||||
if( ( pev->flags & FL_PROXY ) || allow_spectators.value || mp_coop.value )
|
||||
{
|
||||
edict_t *pentSpawnSpot = g_pGameRules->GetPlayerSpawnSpot( pPlayer );
|
||||
pPlayer->StartObserver( pev->origin, VARS( pentSpawnSpot )->angles );
|
||||
@ -625,7 +625,9 @@ void ClientCommand( edict_t *pEntity )
|
||||
// notify other clients of player left spectators
|
||||
UTIL_ClientPrintAll( HUD_PRINTNOTIFY, UTIL_VarArgs( "%s has left spectator mode\n",
|
||||
( pev->netname && ( STRING( pev->netname ) )[0] != 0 ) ? STRING( pev->netname ) : "unconnected" ) );
|
||||
}
|
||||
}*/
|
||||
pPlayer->RemoveAllItems(TRUE);
|
||||
UTIL_BecomeSpectator(pPlayer);
|
||||
}
|
||||
else if( FStrEq( pcmd, "specmode" ) ) // new spectator mode
|
||||
{
|
||||
|
@ -221,7 +221,7 @@ void UTIL_BecomeSpectator( CBasePlayer *pPlayer )
|
||||
{
|
||||
//pPlayer->m_bDoneFirstSpawn = true;
|
||||
pPlayer->pev->takedamage = DAMAGE_NO;
|
||||
pPlayer->pev->flags |= FL_SPECTATOR;
|
||||
//pPlayer->pev->flags |= FL_SPECTATOR;
|
||||
pPlayer->pev->flags |= FL_NOTARGET;
|
||||
pPlayer->pev->effects |= EF_NODRAW;
|
||||
pPlayer->pev->solid = SOLID_NOT;
|
||||
@ -229,11 +229,15 @@ void UTIL_BecomeSpectator( CBasePlayer *pPlayer )
|
||||
pPlayer->pev->modelindex = 0;
|
||||
pPlayer->pev->health = 1;
|
||||
pPlayer->m_pGoalEnt = NULL;
|
||||
//pPlayer->StopObserver();
|
||||
//while( !pPlayer->IsObserver() )
|
||||
//pPlayer->StartObserver(pPlayer->pev->origin, pPlayer->pev->angles);
|
||||
return;
|
||||
}
|
||||
|
||||
void UTIL_SpawnPlayer( CBasePlayer *pPlayer )
|
||||
{
|
||||
//pPlayer->StopObserver();
|
||||
pPlayer->gravgunmod_data.m_state = STATE_SPAWNED;
|
||||
pPlayer->m_iRespawnFrames = 0;
|
||||
pPlayer->pev->effects &= ~EF_NODRAW;
|
||||
@ -242,7 +246,7 @@ void UTIL_SpawnPlayer( CBasePlayer *pPlayer )
|
||||
pPlayer->pev->flags &= ~FL_SPECTATOR;
|
||||
pPlayer->pev->movetype = MOVETYPE_WALK;
|
||||
pPlayer->Spawn();
|
||||
|
||||
//pPlayer->StopObserver();
|
||||
if( mp_coop.value )
|
||||
CLIENT_COMMAND( pPlayer->edict(), "touch_show _coopm*\n" );
|
||||
|
||||
|
@ -627,6 +627,7 @@ void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer )
|
||||
if( pPlayer->gravgunmod_data.m_state == STATE_UNINITIALIZED )
|
||||
{
|
||||
ClientPutInServer( pPlayer->edict() );
|
||||
UTIL_BecomeSpectator( pPlayer );
|
||||
return;
|
||||
}
|
||||
|
||||
@ -638,7 +639,7 @@ void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer )
|
||||
return;
|
||||
}
|
||||
|
||||
if( mp_coop_changelevel.value && pPlayer->gravgunmod_data.m_state == STATE_POINT_SELECT && !(pPlayer->pev->flags & FL_SPECTATOR) )
|
||||
if( mp_coop_changelevel.value && pPlayer->gravgunmod_data.m_state == STATE_POINT_SELECT && !pPlayer->IsObserver() )
|
||||
{
|
||||
pPlayer->RemoveAllItems( TRUE );
|
||||
UTIL_BecomeSpectator( pPlayer );
|
||||
|
Loading…
x
Reference in New Issue
Block a user