- Moved bot related variables from player_t into a new FBot class.

This commit is contained in:
ChillyDoom 2014-10-13 18:40:25 +01:00
commit 83d84eaae9
20 changed files with 325 additions and 344 deletions

View file

@ -875,7 +875,7 @@ static void ChangeSpy (int changespy)
pnum &= MAXPLAYERS-1;
if (playeringame[pnum] &&
(!checkTeam || players[pnum].mo->IsTeammate (players[consoleplayer].mo) ||
(bot_allowspy && players[pnum].isbot)))
(bot_allowspy && players[pnum].Bot.isbot)))
{
break;
}
@ -1156,7 +1156,7 @@ void G_Ticker ()
Printf ("%s is turbo!\n", players[i].userinfo.GetName());
}
if (netgame && !players[i].isbot && !demoplayback && (gametic%ticdup) == 0)
if (netgame && !players[i].Bot.isbot && !demoplayback && (gametic%ticdup) == 0)
{
//players[i].inconsistant = 0;
if (gametic > BACKUPTICS*ticdup && consistancy[i][buf] != cmd->consistancy)
@ -1351,7 +1351,7 @@ void G_PlayerReborn (int player)
itemcount = p->itemcount;
secretcount = p->secretcount;
currclass = p->CurrentPlayerClass;
b_skill = p->skill; //Added by MC:
b_skill = p->Bot.skill; //Added by MC:
userinfo.TransferFrom(p->userinfo);
actor = p->mo;
cls = p->cls;
@ -1374,7 +1374,7 @@ void G_PlayerReborn (int player)
p->LogText = log;
p->cheats |= chasecam;
p->skill = b_skill; //Added by MC:
p->Bot.skill = b_skill; //Added by MC:
p->oldbuttons = ~0, p->attackdown = true; p->usedown = true; // don't do anything immediately
p->original_oldbuttons = ~0;
@ -1386,11 +1386,11 @@ void G_PlayerReborn (int player)
p->ReadyWeapon = p->PendingWeapon;
}
//Added by MC: Init bot structure.
if (bglobal.botingame[player])
bglobal.CleanBotstuff (p);
else
p->isbot = false;
//Added by MC: Init bot structure.
if (bglobal.botingame[player])
bglobal.CleanBotstuff (p);
else
p->Bot.isbot = false;
}
//