From df2600cbea624caff102a04cf1bc8e2a4dd497f3 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 6 Oct 2019 12:13:13 +0100 Subject: [PATCH] Resolve #208. * Tailsbots can't get into Minecarts. * Tailsbots will stop trying to move around when the player gets pw_carry, which usually means some sort of big gimmick is happening and trying to move along with it would make the tailsbot look stupid. --- src/b_bot.c | 5 ++++- src/p_inter.c | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index 17211b353..e027ec03c 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -140,6 +140,9 @@ void B_BuildTiccmd(player_t *player, ticcmd_t *cmd) void B_KeysToTiccmd(mobj_t *mo, ticcmd_t *cmd, boolean forward, boolean backward, boolean left, boolean right, boolean strafeleft, boolean straferight, boolean jump, boolean spin) { + // don't try to do stuff if your sonic is in a minecart or something + if (players[consoleplayer].powers[pw_carry]) + return; // Turn the virtual keypresses into ticcmd_t. if (twodlevel || mo->flags2 & MF2_TWOD) { if (players[consoleplayer].climbing @@ -218,7 +221,7 @@ boolean B_CheckRespawn(player_t *player) return false; // Low ceiling, do not want! - if (sonic->ceilingz - sonic->z < 2*sonic->height) + if (sonic->ceilingz - sonic->z < (sonic->player->exiting ? 6 : 3)*sonic->height) // increased for new camera height return false; // If you're dead, wait a few seconds to respawn. diff --git a/src/p_inter.c b/src/p_inter.c index 403f36b53..3def80f51 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1765,7 +1765,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; case MT_MINECARTSPAWNER: - if (!special->fuse || player->powers[pw_carry] != CR_MINECART) + if (!player->bot && (special->fuse < TICRATE || player->powers[pw_carry] != CR_MINECART)) { mobj_t *mcart = P_SpawnMobj(special->x, special->y, special->z, MT_MINECART); P_SetTarget(&mcart->target, toucher); @@ -1775,7 +1775,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_ResetPlayer(player); player->pflags |= PF_JUMPDOWN; player->powers[pw_carry] = CR_MINECART; - toucher->player->pflags &= ~PF_APPLYAUTOBRAKE; + player->pflags &= ~PF_APPLYAUTOBRAKE; P_SetTarget(&toucher->tracer, mcart); toucher->momx = toucher->momy = toucher->momz = 0;