From 25fb318a0b1f128cb6ae9ffac4f3857fd9dc7355 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 4 Jul 2017 14:58:58 +0100 Subject: [PATCH] * Fixed a typo with the bit-shifting of the max speed, meaning that it wasn't being set as desired. * Made the speed capping/minimising done at the point of changing it via player control, as opposed to the point of macerotate, in an attempt to fix a potential cause of mace rotation desynchronisation (not netplay, just https://cdn.discordapp.com/attachments/293238104096112641/331453363499696139/srb20180.gif stuff.) --- src/p_mobj.c | 6 +----- src/p_user.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 57df82578..f95d5a0a5 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6488,10 +6488,6 @@ static void P_MaceRotate(mobj_t *mobj) maceretry: - // Set the top speed for the link if it happens to be over that speed. - if (mobj->tracer->lastlook > mobj->tracer->friction) - mobj->tracer->lastlook = mobj->tracer->friction; - fa = (FixedAngle(mobj->tracer->movefactor*FRACUNIT) >> ANGLETOFINESHIFT); radius = FixedMul(FINECOSINE(fa), radius); v[1] = -FixedMul(FINESINE(fa), radius) @@ -9951,7 +9947,7 @@ ML_EFFECT4 : Don't clip inside the ground mlength = abs(lines[line].dx >> FRACBITS); mspeed = abs(lines[line].dy >> (FRACBITS - 4)); mphase = (sides[lines[line].sidenum[0]].textureoffset >> FRACBITS) % 360; - if ((mmaxspeed = sides[lines[line].sidenum[0]].rowoffset >> FRACBITS) < mspeed) + if ((mmaxspeed = sides[lines[line].sidenum[0]].rowoffset >> (FRACBITS - 4)) < mspeed) mmaxspeed = mspeed << 1; mpitch = (lines[line].frontsector->floorheight >> FRACBITS) % 360; myaw = (lines[line].frontsector->ceilingheight >> FRACBITS) % 360; diff --git a/src/p_user.c b/src/p_user.c index 707e2e302..519bffa3f 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9985,9 +9985,15 @@ void P_PlayerAfterThink(player_t *player) player->pflags &= ~PF_THOKKED; if (cmd->forwardmove > 0) - player->mo->tracer->tracer->lastlook += 2; - else if (cmd->forwardmove < 0 && player->mo->tracer->tracer->lastlook > player->mo->tracer->tracer->movecount) - player->mo->tracer->tracer->lastlook -= 2; + { + if ((player->mo->tracer->tracer->lastlook += 2) > player->mo->tracer->tracer->friction) + player->mo->tracer->tracer->lastlook = player->mo->tracer->tracer->friction; + } + else if (cmd->forwardmove < 0) + { + if ((player->mo->tracer->tracer->lastlook -= 2) < player->mo->tracer->tracer->movecount) + player->mo->tracer->tracer->lastlook = player->mo->tracer->tracer->movecount; + } if ((player->mo->tracer->tracer->flags & MF_SLIDEME) // Noclimb on chain parameters gives this && !(twodlevel || player->mo->flags2 & MF2_TWOD)) // why on earth would you want to turn them in 2D mode?