Updated references to player->bot

This commit is contained in:
Shane Ellis 2021-01-23 10:15:33 -05:00
parent 2abf89e800
commit 2e528216ac

View file

@ -776,8 +776,8 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
{
UINT8 oldmare, oldmarelap, oldmarebonuslap;
// Bots can't be NiGHTSerized, silly!1 :P
if (player->bot && player->bot != 3)
//! Bots can't be NiGHTSerized, silly!1 :P
if (player->bot == BOT_2PAI || player->bot || BOT_2PHUMAN)
return;
if (player->powers[pw_carry] != CR_NIGHTSMODE)
@ -1188,9 +1188,9 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings)
{
if (!player)
return;
if (player->bot && player->bot != 3)
player = &players[consoleplayer];
//!
if ((player->bot == BOT_2PAI || player->bot == BOT_2PHUMAN) && player->botleader)
player = player->botleader;
if (!player->mo)
return;
@ -1234,8 +1234,8 @@ void P_GivePlayerSpheres(player_t *player, INT32 num_spheres)
if (!player)
return;
if (player->bot && player->bot != 3)
player = &players[consoleplayer];
if ((player->bot == BOT_2PAI || player->bot == BOT_2PHUMAN) && player->botleader)
player = player->botleader;
if (!player->mo)
return;
@ -1261,8 +1261,8 @@ void P_GivePlayerLives(player_t *player, INT32 numlives)
if (!player)
return;
if (player->bot && player->bot != 3)
player = &players[consoleplayer];
if ((player->bot == BOT_2PAI || player->bot == BOT_2PHUMAN) && player->botleader)
player = player->botleader;
if (gamestate == GS_LEVEL)
{
@ -1367,8 +1367,8 @@ void P_AddPlayerScore(player_t *player, UINT32 amount)
{
UINT32 oldscore;
if (player->bot && player->bot != 3)
player = &players[consoleplayer];
if ((player->bot == BOT_2PAI || player->bot == BOT_2PHUMAN) && player->botleader)
player = player->botleader;
// NiGHTS does it different!
if (gamestate == GS_LEVEL && mapheaderinfo[gamemap-1]->typeoflevel & TOL_NIGHTS)
@ -5370,7 +5370,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
player->powers[pw_tailsfly] = tailsflytics + 1; // Set the fly timer
player->pflags &= ~(PF_JUMPED|PF_NOJUMPDAMAGE|PF_SPINNING|PF_STARTDASH);
if (player->bot == 1)
if (player->bot == BOT_2PAI)
player->pflags |= PF_THOKKED;
else
player->pflags |= (PF_THOKKED|PF_CANCARRY);
@ -5957,7 +5957,8 @@ static void P_3dMovement(player_t *player)
acceleration = 96 + (FixedDiv(player->speed, player->mo->scale)>>FRACBITS) * 40;
topspeed = normalspd;
}
else if (player->bot && player->bot != 3)
//! Kill this!
/* else if (player->bot == BOT_2PAI || player->bot == BOT_2PHUMAN)
{ // Bot steals player 1's stats
normalspd = FixedMul(players[consoleplayer].normalspeed, player->mo->scale);
thrustfactor = players[consoleplayer].thrustfactor;
@ -5972,7 +5973,7 @@ static void P_3dMovement(player_t *player)
}
else
topspeed = normalspd;
}
} */
else
{
if (player->powers[pw_super] || player->powers[pw_sneakers])
@ -9497,7 +9498,7 @@ static void P_DeathThink(player_t *player)
if (player->deadtimer < INT32_MAX)
player->deadtimer++;
if (player->bot && player->bot != 3) // don't allow bots to do any of the below, B_CheckRespawn does all they need for respawning already
if (player->bot == BOT_2PAI || player->bot == BOT_2PHUMAN) // don't allow followbots to do any of the below, B_CheckRespawn does all they need for respawning already
goto notrealplayer;
// continue logic
@ -11473,6 +11474,9 @@ void P_PlayerThink(player_t *player)
I_Error("p_playerthink: players[%s].mo == NULL", sizeu1(playeri));
#endif
//! Reset terrain blocked status for this frame
player->blocked = false;
// todo: Figure out what is actually causing these problems in the first place...
if (player->mo->health <= 0 && player->playerstate == PST_LIVE) //you should be DEAD!
{
@ -11480,7 +11484,7 @@ void P_PlayerThink(player_t *player)
player->playerstate = PST_DEAD;
}
if (player->bot && player->bot != 3)
if (player->bot == BOT_2PAI || player->bot == BOT_2PHUMAN)
{
if (player->playerstate == PST_LIVE || player->playerstate == PST_DEAD)
{
@ -11623,8 +11627,8 @@ void P_PlayerThink(player_t *player)
INT32 i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator || players[i].bot)
{ //!
if (!playeringame[i] || players[i].spectator || players[i].bot == BOT_2PAI || players[i].bot == BOT_2PHUMAN)
continue;
if (players[i].lives <= 0)
continue;
@ -11655,8 +11659,8 @@ void P_PlayerThink(player_t *player)
INT32 i, total = 0, exiting = 0;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator || players[i].bot)
{ //!
if (!playeringame[i] || players[i].spectator || players[i].bot == BOT_2PAI || players[i].bot == BOT_2PHUMAN)
continue;
if (players[i].quittime > 30 * TICRATE)
continue;
@ -12596,8 +12600,8 @@ void P_PlayerAfterThink(player_t *player)
player->mo->momy = tails->momy;
player->mo->momz = tails->momz;
}
if (G_CoopGametype() && tails->player && tails->player->bot != 1)
//!
if (G_CoopGametype() && tails->player && tails->player->bot != BOT_2PAI)
{
player->mo->angle = tails->angle;