- Renamed FBot to DBot and made it inherit from DThinker.

- Fixed: Bots added by players other than the net arbitrator did not have their skill set.
This commit is contained in:
ChillyDoom 2014-10-14 19:57:11 +01:00
commit db323643f8
24 changed files with 356 additions and 327 deletions

View file

@ -100,10 +100,10 @@ void P_TouchSpecialThing (AActor *special, AActor *toucher)
return;
//Added by MC: Finished with this destination.
if (toucher->player != NULL && toucher->player->Bot.isbot && special == toucher->player->Bot.dest)
if (toucher->player != NULL && toucher->player->Bot != NULL && special == toucher->player->Bot->dest)
{
toucher->player->Bot.prev = toucher->player->Bot.dest;
toucher->player->Bot.dest = NULL;
toucher->player->Bot->prev = toucher->player->Bot->dest;
toucher->player->Bot->dest = NULL;
}
special->Touch (toucher);
@ -608,17 +608,17 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags)
//Added by MC: Respawn bots
if (bglobal.botnum && consoleplayer == Net_Arbitrator && !demoplayback)
{
if (player->Bot.isbot)
player->Bot.t_respawn = (pr_botrespawn()%15)+((bglobal.botnum-1)*2)+TICRATE+1;
if (player->Bot != NULL)
player->Bot->t_respawn = (pr_botrespawn()%15)+((bglobal.botnum-1)*2)+TICRATE+1;
//Added by MC: Discard enemies.
for (int i = 0; i < MAXPLAYERS; i++)
{
if (players[i].Bot.isbot && this == players[i].Bot.enemy)
if (players[i].Bot != NULL && this == players[i].Bot->enemy)
{
if (players[i].Bot.dest == players[i].Bot.enemy)
players[i].Bot.dest = NULL;
players[i].Bot.enemy = NULL;
if (players[i].Bot->dest == players[i].Bot->enemy)
players[i].Bot->dest = NULL;
players[i].Bot->enemy = NULL;
}
}
@ -1194,9 +1194,9 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
if (player)
{
//Added by MC: Lets bots look allround for enemies if they survive an ambush.
if (player->Bot.isbot)
if (player->Bot != NULL)
{
player->Bot.allround = true;
player->Bot->allround = true;
}
// end of game hell hack