- Made DBot inherit from DObject.

This commit is contained in:
ChillyDoom 2014-10-15 17:54:12 +01:00
commit c400dcf736
6 changed files with 41 additions and 21 deletions

View file

@ -24,6 +24,11 @@ IMPLEMENT_POINTY_CLASS(DBot)
END_POINTERS
DBot::DBot ()
{
Clear ();
}
void DBot::Clear ()
{
savedyaw = 0;
savedpitch = 0;
@ -123,6 +128,11 @@ void FCajunMaster::ClearPlayer (int i, bool keepTeam)
bot->inuse = false;
bot->lastteam = keepTeam ? players[i].userinfo.GetTeam() : TEAM_NONE;
}
if (players[i].Bot != NULL)
{
players[i].Bot->Destroy ();
players[i].Bot = NULL;
}
players[i].~player_t();
::new(&players[i]) player_t;
players[i].userinfo.Reset();