Bot Controller uses args

This commit is contained in:
Sally Coolatta 2022-10-10 10:26:25 -04:00
parent 983304f361
commit 1ab2b4a897
3 changed files with 24 additions and 6 deletions

View file

@ -510,8 +510,8 @@ fixed_t K_BotRubberband(player_t *player)
if (botController != NULL)
{
// No Climb Flag: Disable rubberbanding
if (botController->flags & ML_NOCLIMB)
// Disable rubberbanding
if (botController->args[1] & TMBOT_NORUBBERBAND)
{
return FRACUNIT;
}
@ -931,7 +931,7 @@ static void K_BotTrick(player_t *player, ticcmd_t *cmd, line_t *botController)
if (player->trickpanel == 1)
{
INT32 type = (sides[botController->sidenum[0]].rowoffset / FRACUNIT);
INT32 type = botController->args[0];
// Y Offset: Trick type
switch (type)
@ -1318,7 +1318,7 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
return;
}
if (botController != NULL && (botController->flags & ML_NOSKEW)) // FIXME: UDMF-ify
if (botController != NULL && (botController->args[1] & TMBOT_NOCONTROL)) // FIXME: UDMF-ify
{
// Disable bot controls entirely.
return;
@ -1326,12 +1326,12 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd)
destangle = player->mo->angle;
if (botController != NULL && (botController->flags & ML_SKEWTD)) // FIXME: UDMF-ify
if (botController != NULL && (botController->args[1] & TMBOT_FORCEDIR)) // FIXME: UDMF-ify
{
const fixed_t dist = DEFAULT_WAYPOINT_RADIUS * player->mo->scale;
// X Offset: Movement direction
destangle = FixedAngle(sides[botController->sidenum[0]].textureoffset);
destangle = FixedAngle(botController->args[2] * FRACUNIT);
// Overwritten prediction
predict = Z_Calloc(sizeof(botprediction_t), PU_STATIC, NULL);

View file

@ -5785,6 +5785,17 @@ static void P_ConvertBinaryLinedefTypes(void)
if (lines[i].flags & ML_NOCLIMB)
lines[i].args[0] |= TMCRF_FRONTONLY;
break;
case 2004: //Bot controller
botController->args[0] = sides[botController->sidenum[0]].rowoffset / FRACUNIT;
if (lines[i].flags & ML_NOCLIMB)
lines[i].args[1] |= TMBOT_NORUBBERBAND;
if (lines[i].flags & ML_NOSKEW)
lines[i].args[1] |= TMBOT_NOCONTROL;
if (lines[i].flags & ML_SKEWTD)
lines[i].args[1] |= TMBOT_FORCEDIR;
botController->args[2] = sides[botController->sidenum[0]].textureoffset / FRACUNIT;
default:
break;
}

View file

@ -494,6 +494,13 @@ typedef enum
TMCRF_FRONTONLY = 1,
} textmapcrossrespawnflags_t;
typedef enum
{
TMBOT_NORUBBERBAND = 1,
TMBOT_NOCONTROL = 1<<1,
TMBOT_FORCEDIR = 1<<2,
} textmapbotcontroller_t;
// GETSECSPECIAL (specialval, section)
//
// Pulls out the special # from a particular section.