Browse Source

Observer seems to be complete broken, restore old mode

gravgun
mittorn 6 years ago
parent
commit
48201dfcc3
  1. 8
      dlls/client.cpp
  2. 8
      dlls/coop.cpp
  3. 3
      dlls/multiplay_gamerules.cpp

8
dlls/client.cpp

@ -603,10 +603,10 @@ void ClientCommand( edict_t *pEntity )
else if( FStrEq( pcmd, "spectate" ) ) // clients wants to become a spectator else if( FStrEq( pcmd, "spectate" ) ) // clients wants to become a spectator
{ {
CBasePlayer *pPlayer = GetClassPtr( (CBasePlayer *)pev ); CBasePlayer *pPlayer = GetClassPtr( (CBasePlayer *)pev );
if( !pPlayer->IsObserver() ) /*if( !pPlayer->IsObserver() )
{ {
// always allow proxies to become a spectator // 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 ); edict_t *pentSpawnSpot = g_pGameRules->GetPlayerSpawnSpot( pPlayer );
pPlayer->StartObserver( pev->origin, VARS( pentSpawnSpot )->angles ); pPlayer->StartObserver( pev->origin, VARS( pentSpawnSpot )->angles );
@ -625,7 +625,9 @@ void ClientCommand( edict_t *pEntity )
// notify other clients of player left spectators // notify other clients of player left spectators
UTIL_ClientPrintAll( HUD_PRINTNOTIFY, UTIL_VarArgs( "%s has left spectator mode\n", UTIL_ClientPrintAll( HUD_PRINTNOTIFY, UTIL_VarArgs( "%s has left spectator mode\n",
( pev->netname && ( STRING( pev->netname ) )[0] != 0 ) ? STRING( pev->netname ) : "unconnected" ) ); ( 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 else if( FStrEq( pcmd, "specmode" ) ) // new spectator mode
{ {

8
dlls/coop.cpp

@ -221,7 +221,7 @@ void UTIL_BecomeSpectator( CBasePlayer *pPlayer )
{ {
//pPlayer->m_bDoneFirstSpawn = true; //pPlayer->m_bDoneFirstSpawn = true;
pPlayer->pev->takedamage = DAMAGE_NO; pPlayer->pev->takedamage = DAMAGE_NO;
pPlayer->pev->flags |= FL_SPECTATOR; //pPlayer->pev->flags |= FL_SPECTATOR;
pPlayer->pev->flags |= FL_NOTARGET; pPlayer->pev->flags |= FL_NOTARGET;
pPlayer->pev->effects |= EF_NODRAW; pPlayer->pev->effects |= EF_NODRAW;
pPlayer->pev->solid = SOLID_NOT; pPlayer->pev->solid = SOLID_NOT;
@ -229,11 +229,15 @@ void UTIL_BecomeSpectator( CBasePlayer *pPlayer )
pPlayer->pev->modelindex = 0; pPlayer->pev->modelindex = 0;
pPlayer->pev->health = 1; pPlayer->pev->health = 1;
pPlayer->m_pGoalEnt = NULL; pPlayer->m_pGoalEnt = NULL;
//pPlayer->StopObserver();
//while( !pPlayer->IsObserver() )
//pPlayer->StartObserver(pPlayer->pev->origin, pPlayer->pev->angles);
return; return;
} }
void UTIL_SpawnPlayer( CBasePlayer *pPlayer ) void UTIL_SpawnPlayer( CBasePlayer *pPlayer )
{ {
//pPlayer->StopObserver();
pPlayer->gravgunmod_data.m_state = STATE_SPAWNED; pPlayer->gravgunmod_data.m_state = STATE_SPAWNED;
pPlayer->m_iRespawnFrames = 0; pPlayer->m_iRespawnFrames = 0;
pPlayer->pev->effects &= ~EF_NODRAW; pPlayer->pev->effects &= ~EF_NODRAW;
@ -242,7 +246,7 @@ void UTIL_SpawnPlayer( CBasePlayer *pPlayer )
pPlayer->pev->flags &= ~FL_SPECTATOR; pPlayer->pev->flags &= ~FL_SPECTATOR;
pPlayer->pev->movetype = MOVETYPE_WALK; pPlayer->pev->movetype = MOVETYPE_WALK;
pPlayer->Spawn(); pPlayer->Spawn();
//pPlayer->StopObserver();
if( mp_coop.value ) if( mp_coop.value )
CLIENT_COMMAND( pPlayer->edict(), "touch_show _coopm*\n" ); CLIENT_COMMAND( pPlayer->edict(), "touch_show _coopm*\n" );

3
dlls/multiplay_gamerules.cpp

@ -627,6 +627,7 @@ void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer )
if( pPlayer->gravgunmod_data.m_state == STATE_UNINITIALIZED ) if( pPlayer->gravgunmod_data.m_state == STATE_UNINITIALIZED )
{ {
ClientPutInServer( pPlayer->edict() ); ClientPutInServer( pPlayer->edict() );
UTIL_BecomeSpectator( pPlayer );
return; return;
} }
@ -638,7 +639,7 @@ void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer )
return; 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 ); pPlayer->RemoveAllItems( TRUE );
UTIL_BecomeSpectator( pPlayer ); UTIL_BecomeSpectator( pPlayer );

Loading…
Cancel
Save