Skip to content

Commit

Permalink
Fix demo playback support
Browse files Browse the repository at this point in the history
  • Loading branch information
tmyqlfpir authored and nukeykt committed Jun 28, 2023
1 parent 3843a7f commit 0833b76
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source/blood/src/demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ void CDemo::ReadInput(int nCount)
pInput->syncFlags.run = bitReader.readBit();
bitReader.skipBits(26);
pInput->forward = bitReader.readSigned(8) << 8;
pInput->q16turn = fix16_from_int(bitReader.readSigned(16) >> 2);
pInput->q16turn = fix16_from_int(bitReader.readSigned(16)) >> 2;
pInput->strafe = bitReader.readSigned(8) << 8;
pInput->buttonFlags.jump = bitReader.readBit();
pInput->buttonFlags.crouch = bitReader.readBit();
Expand Down
7 changes: 6 additions & 1 deletion source/blood/src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1482,7 +1482,12 @@ void ProcessInput(PLAYER *pPlayer)
}
}
if (pInput->q16turn)
pPlayer->q16ang = (pPlayer->q16ang+pInput->q16turn)&0x7ffffff;
{
if (bVanilla)
pPlayer->q16ang = ((pPlayer->q16ang&0x7ff0000)+(pInput->q16turn&0x7ff0000))&0x7ffffff;
else
pPlayer->q16ang = (pPlayer->q16ang+pInput->q16turn)&0x7ffffff;
}
if (pInput->keyFlags.spin180)
{
if (!pPlayer->spin)
Expand Down
7 changes: 6 additions & 1 deletion source/blood/src/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,12 @@ void fakeProcessInput(PLAYER *pPlayer, GINPUT *pInput)
}
}
if (pInput->q16turn)
predict.at30 = (predict.at30+pInput->q16turn)&0x7ffffff;
{
if (bVanilla)
predict.at30 = ((predict.at30&0x7ff0000)+(pInput->q16turn&0x7ff0000))&0x7ffffff;
else
predict.at30 = (predict.at30+pInput->q16turn)&0x7ffffff;
}
if (pInput->keyFlags.spin180)
if (!predict.at4c)
predict.at4c = -kAng180;
Expand Down

0 comments on commit 0833b76

Please sign in to comment.