- Moved bot thinking logic into DBot.
This commit is contained in:
parent
5e6c375974
commit
ee977f94d7
12 changed files with 153 additions and 135 deletions
|
|
@ -30,6 +30,7 @@ DBot::DBot ()
|
|||
|
||||
void DBot::Clear ()
|
||||
{
|
||||
player = NULL;
|
||||
angle = 0;
|
||||
dest = NULL;
|
||||
prev = NULL;
|
||||
|
|
@ -64,6 +65,10 @@ void DBot::Serialize (FArchive &arc)
|
|||
arc << savedyaw
|
||||
<< savedpitch;
|
||||
}
|
||||
else if (SaveVersion >= 4516)
|
||||
{
|
||||
arc << player;
|
||||
}
|
||||
|
||||
arc << angle
|
||||
<< dest
|
||||
|
|
@ -88,6 +93,22 @@ void DBot::Serialize (FArchive &arc)
|
|||
<< oldy;
|
||||
}
|
||||
|
||||
void DBot::Tick ()
|
||||
{
|
||||
Super::Tick ();
|
||||
|
||||
if (player->mo == NULL || bglobal.freeze)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BotThinkCycles.Clock();
|
||||
bglobal.m_Thinking = true;
|
||||
bglobal.Think (player->mo, &netcmds[player - players][((gametic + 1)/ticdup)%BACKUPTICS]);
|
||||
bglobal.m_Thinking = false;
|
||||
BotThinkCycles.Unclock();
|
||||
}
|
||||
|
||||
CVAR (Int, bot_next_color, 11, 0)
|
||||
CVAR (Bool, bot_observer, false, 0)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue