- Moved bot related variables from player_t into a new FBot class.
This commit is contained in:
parent
952d03da7c
commit
83d84eaae9
20 changed files with 325 additions and 344 deletions
|
|
@ -697,7 +697,7 @@ void PlayerIsGone (int netnode, int netconsole)
|
|||
// Pick a new network arbitrator
|
||||
for (int i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (i != netconsole && playeringame[i] && !players[i].isbot)
|
||||
if (i != netconsole && playeringame[i] && !players[i].Bot.isbot)
|
||||
{
|
||||
Net_Arbitrator = i;
|
||||
players[i].settings_controller = true;
|
||||
|
|
@ -902,7 +902,7 @@ void GetPackets (void)
|
|||
|
||||
for (i = 0; i < numplayers; ++i)
|
||||
{
|
||||
int node = !players[playerbytes[i]].isbot ?
|
||||
int node = !players[playerbytes[i]].Bot.isbot ?
|
||||
nodeforplayer[playerbytes[i]] : netnode;
|
||||
|
||||
SkipTicCmd (&start, nettics[node] - realstart);
|
||||
|
|
@ -918,7 +918,7 @@ void GetPackets (void)
|
|||
// packet.
|
||||
for (i = 0; i < numplayers; ++i)
|
||||
{
|
||||
if (!players[playerbytes[i]].isbot)
|
||||
if (!players[playerbytes[i]].Bot.isbot)
|
||||
{
|
||||
nettics[nodeforplayer[playerbytes[i]]] = realend;
|
||||
}
|
||||
|
|
@ -935,10 +935,10 @@ void AdjustBots (int gameticdiv)
|
|||
// be in even when gametic lags behind maketic.
|
||||
for (int i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playeringame[i] && players[i].isbot && players[i].mo)
|
||||
if (playeringame[i] && players[i].Bot.isbot && players[i].mo)
|
||||
{
|
||||
players[i].savedyaw = players[i].mo->angle;
|
||||
players[i].savedpitch = players[i].mo->pitch;
|
||||
players[i].Bot.savedyaw = players[i].mo->angle;
|
||||
players[i].Bot.savedpitch = players[i].mo->pitch;
|
||||
for (int j = gameticdiv; j < maketic/ticdup; j++)
|
||||
{
|
||||
players[i].mo->angle += (netcmds[i][j%BACKUPTICS].ucmd.yaw << 16) * ticdup;
|
||||
|
|
@ -952,10 +952,10 @@ void UnadjustBots ()
|
|||
{
|
||||
for (int i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playeringame[i] && players[i].isbot && players[i].mo)
|
||||
if (playeringame[i] && players[i].Bot.isbot && players[i].mo)
|
||||
{
|
||||
players[i].mo->angle = players[i].savedyaw;
|
||||
players[i].mo->pitch = players[i].savedpitch;
|
||||
players[i].mo->angle = players[i].Bot.savedyaw;
|
||||
players[i].mo->pitch = players[i].Bot.savedpitch;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1127,7 +1127,7 @@ void NetUpdate (void)
|
|||
{
|
||||
if (playeringame[j])
|
||||
{
|
||||
if (players[j].isbot || NetMode == NET_PacketServer)
|
||||
if (players[j].Bot.isbot || NetMode == NET_PacketServer)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
|
|
@ -1269,7 +1269,7 @@ void NetUpdate (void)
|
|||
{
|
||||
if (playeringame[j] && j != playerfornode[i] && j != consoleplayer)
|
||||
{
|
||||
if (players[j].isbot || NetMode == NET_PacketServer)
|
||||
if (players[j].Bot.isbot || NetMode == NET_PacketServer)
|
||||
{
|
||||
playerbytes[l++] = j;
|
||||
netbuffer[k++] = j;
|
||||
|
|
@ -1308,9 +1308,8 @@ void NetUpdate (void)
|
|||
}
|
||||
else if (i != 0)
|
||||
{
|
||||
if (players[playerbytes[l]].isbot)
|
||||
if (players[playerbytes[l]].Bot.isbot)
|
||||
{
|
||||
|
||||
WriteWord (0, &cmddata); // fake consistancy word
|
||||
}
|
||||
else
|
||||
|
|
@ -2875,7 +2874,7 @@ static void Network_Controller (int playernum, bool add)
|
|||
return;
|
||||
}
|
||||
|
||||
if (players[playernum].isbot)
|
||||
if (players[playernum].Bot.isbot)
|
||||
{
|
||||
Printf ("Bots cannot be added to the controller list.\n");
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue