mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-26 06:11:01 +00:00
Fix AI angling
This commit is contained in:
parent
00697caa6e
commit
b120193eb7
1 changed files with 6 additions and 6 deletions
12
src/b_bot.c
12
src/b_bot.c
|
@ -114,11 +114,11 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm
|
||||||
// Orientation
|
// Orientation
|
||||||
if ((bot->pflags & (PF_SPINNING|PF_STARTDASH)) || flymode == 2)
|
if ((bot->pflags & (PF_SPINNING|PF_STARTDASH)) || flymode == 2)
|
||||||
{
|
{
|
||||||
tails->angle = sonic->angle;
|
cmd->angleturn = (sonic->angle - tails->angle) >> FRACBITS;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tails->angle = ang;
|
cmd->angleturn = (ang - tails->angle) >> FRACBITS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ********
|
// ********
|
||||||
|
@ -219,14 +219,14 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm
|
||||||
{
|
{
|
||||||
if (dist < followthres && dist > touchdist) // Do positioning
|
if (dist < followthres && dist > touchdist) // Do positioning
|
||||||
{
|
{
|
||||||
tails->angle = ang;
|
cmd->angleturn = (ang - tails->angle) >> FRACBITS;
|
||||||
cmd->forwardmove = 50;
|
cmd->forwardmove = 50;
|
||||||
spinmode = true;
|
spinmode = true;
|
||||||
}
|
}
|
||||||
else if (dist < touchdist && !bmom
|
else if (dist < touchdist && !bmom
|
||||||
&& (!(bot->pflags & PF_SPINNING) || (bot->dashspeed && bot->pflags & PF_SPINNING)))
|
&& (!(bot->pflags & PF_SPINNING) || (bot->dashspeed && bot->pflags & PF_SPINNING)))
|
||||||
{
|
{
|
||||||
tails->angle = sonic->angle;
|
cmd->angleturn = (sonic->angle - tails->angle) >> FRACBITS;
|
||||||
spin = true;
|
spin = true;
|
||||||
spinmode = true;
|
spinmode = true;
|
||||||
}
|
}
|
||||||
|
@ -239,7 +239,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm
|
||||||
if (bot->pflags & PF_SPINNING || !spin_last)
|
if (bot->pflags & PF_SPINNING || !spin_last)
|
||||||
{
|
{
|
||||||
spin = true;
|
spin = true;
|
||||||
tails->angle = sonic->angle;
|
cmd->angleturn = (sonic->angle - tails->angle) >> FRACBITS;
|
||||||
cmd->forwardmove = MAXPLMOVE;
|
cmd->forwardmove = MAXPLMOVE;
|
||||||
spinmode = true;
|
spinmode = true;
|
||||||
}
|
}
|
||||||
|
@ -284,7 +284,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm
|
||||||
else if (dist < followmin)
|
else if (dist < followmin)
|
||||||
{
|
{
|
||||||
// Copy inputs
|
// Copy inputs
|
||||||
tails->angle = sonic->angle;
|
cmd->angleturn = (sonic->angle - tails->angle) >> FRACBITS;
|
||||||
bot->drawangle = player->drawangle;
|
bot->drawangle = player->drawangle;
|
||||||
cmd->forwardmove = 8 * pcmd->forwardmove / 10;
|
cmd->forwardmove = 8 * pcmd->forwardmove / 10;
|
||||||
cmd->sidemove = 8 * pcmd->sidemove / 10;
|
cmd->sidemove = 8 * pcmd->sidemove / 10;
|
||||||
|
|
Loading…
Reference in a new issue