- Moved bot thinking logic into DBot.

This commit is contained in:
ChillyDoom 2014-11-14 16:54:56 +00:00
commit ee977f94d7
12 changed files with 153 additions and 135 deletions

View file

@ -1021,11 +1021,14 @@ void AInventory::Touch (AActor *toucher)
P_GiveSecret(toucher, true, true, -1);
}
DBot *Bot;
TThinkerIterator<DBot> it;
//Added by MC: Check if item taken was the roam destination of any bot
for (int i = 0; i < MAXPLAYERS; i++)
while ((Bot = it.Next ()) != NULL)
{
if (playeringame[i] && players[i].Bot != NULL && this == players[i].Bot->dest)
players[i].Bot->dest = NULL;
if (Bot->dest == this)
Bot->dest = NULL;
}
}