VadaVaka
DM Spectating bug fixed - Printable Version

+- VadaVaka (https://vadavaka.com/forums)
+-- Forum: General Forums (https://vadavaka.com/forums/forumdisplay.php?fid=5)
+--- Forum: IT-Geeks Hang Out (https://vadavaka.com/forums/forumdisplay.php?fid=42)
+---- Forum: Programming (https://vadavaka.com/forums/forumdisplay.php?fid=27)
+---- Thread: DM Spectating bug fixed (/showthread.php?tid=3998)



DM Spectating bug fixed - Miagi - 06-05-2005

I fixed one bug in dm having to do with a players disc rotate around them while they are spectating.


I just added this to the beginning of discthink of disc_weapon_disc.cpp
Code:
void CDisc::DiscThink()
{


//Miagi prevent disc returning to spectators
    if ( ((CBasePlayer*)(CBaseEntity*)m_hOwner)->IsObserver() )
    {
 
 //UTIL_ClientPrintAll( HUD_PRINTNOTIFY, "Observer is true" );
 ReturnToThrower();
 return;

    }
    //End miagi


Now onto making a respawn command.


DM Spectating bug fixed - Miagi - 06-05-2005

K so I've decided against including the respawn command. Not totally needed.

But I did fix being able to hit spectate while you are in spectate. In client.cpp ClientCommand

Code:
else if ( FStrEq(pcmd, "spectate" ) )
    {
 // Prevent this is the cvar is set
 if ( allow_spectators.value )
 {
     CBasePlayer *pPlayer = GetClassPtr((CBasePlayer *)pev);

     //Miagi Prevent hitting spectate inside spectate
     if ( !pPlayer->IsObserver() )
     {
     edict_t *pentSpawnSpot = EntSelectSpawnPoint( pPlayer );
     pPlayer->StartObserver( VARS(pentSpawnSpot)->origin, VARS(pentSpawnSpot)->angles);
     }
 }
    }