- Blood: Lock input after setting angle/horizon targets in nnexts.cpp code, then unlock in ProcessInput() where resetForcedSyncInput() is called.

This commit is contained in:
Mitchell Richters 2021-07-18 19:26:24 +10:00
parent ca65c4c9da
commit 0f5243c39e
2 changed files with 7 additions and 5 deletions

View file

@ -1714,7 +1714,7 @@ void trPlayerCtrlSetLookAngle(XSPRITE* pXSource, PLAYER* pPlayer)
} }
pPlayer->horizon.settarget(100. * tan(adjustment * pi::pi() / 1024.)); pPlayer->horizon.settarget(100. * tan(adjustment * pi::pi() / 1024.));
setForcedSyncInput(); pPlayer->horizon.lockinput();
} }
void trPlayerCtrlEraseStuff(XSPRITE* pXSource, PLAYER* pPlayer) { void trPlayerCtrlEraseStuff(XSPRITE* pXSource, PLAYER* pPlayer) {
@ -2403,7 +2403,7 @@ void useTeleportTarget(XSPRITE* pXSource, spritetype* pSprite) {
if (pPlayer) { if (pPlayer) {
pPlayer->angle.settarget(pSource->ang); pPlayer->angle.settarget(pSource->ang);
setForcedSyncInput(); pPlayer->angle.lockinput();
} }
else if (isDude) xsprite[pSprite->extra].goalAng = pSprite->ang = pSource->ang; else if (isDude) xsprite[pSprite->extra].goalAng = pSprite->ang = pSource->ang;
else pSprite->ang = pSource->ang; else pSprite->ang = pSource->ang;
@ -4695,11 +4695,11 @@ bool modernTypeOperateSprite(int nSprite, spritetype* pSprite, XSPRITE* pXSprite
if (pXSprite->data4 != 0) break; if (pXSprite->data4 != 0) break;
else if (pSprite->flags & kModernTypeFlag1) { else if (pSprite->flags & kModernTypeFlag1) {
pPlayer->angle.settarget(pSprite->ang); pPlayer->angle.settarget(pSprite->ang);
setForcedSyncInput(); pPlayer->angle.lockinput();
} }
else if (valueIsBetween(pXSprite->data2, -kAng360, kAng360)) { else if (valueIsBetween(pXSprite->data2, -kAng360, kAng360)) {
pPlayer->angle.settarget(pXSprite->data2); pPlayer->angle.settarget(pXSprite->data2);
setForcedSyncInput(); pPlayer->angle.lockinput();
} }
break; break;
case 10: // 74 (print the book) case 10: // 74 (print the book)

View file

@ -1548,8 +1548,10 @@ void ProcessInput(PLAYER *pPlayer)
doslopetilting(pPlayer); doslopetilting(pPlayer);
} }
// disable synchronised input if set by game. // disable synchronised input and input locks if set by game.
resetForcedSyncInput(); resetForcedSyncInput();
pPlayer->angle.unlockinput();
pPlayer->horizon.unlockinput();
pPlayer->slope = -pPlayer->horizon.horiz.asq16() >> 9; pPlayer->slope = -pPlayer->horizon.horiz.asq16() >> 9;
if (pInput->actions & SB_INVPREV) if (pInput->actions & SB_INVPREV)