From 44ff4a19c993c2a8fdf6b1734c95dfcac89e5fc4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 9 Sep 2022 19:08:28 +0200 Subject: [PATCH] - handle some sound code fudging --- source/games/exhumed/src/sound.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/games/exhumed/src/sound.cpp b/source/games/exhumed/src/sound.cpp index eebde5516..461eca6e5 100644 --- a/source/games/exhumed/src/sound.cpp +++ b/source/games/exhumed/src/sound.cpp @@ -716,14 +716,15 @@ void UpdateCreepySounds() int vsi = seq_GetFrameSound(SeqOffsets[kSeqCreepy], totalmoves % SeqSize[SeqOffsets[kSeqCreepy]]); if (vsi >= 0 && (vsi & 0x1ff) < kMaxSounds) { - int vdx = (totalmoves + 32) & 31; + DVector2 adder; + adder.X = ((totalmoves + 32) & 31) / 16.; if (totalmoves & 1) - vdx = -vdx; - int vax = (totalmoves + 32) & 63; + adder.X = -adder.X; + adder.Y = ((totalmoves + 32) & 63) / 16.; if (totalmoves & 2) - vax = -vax; + adder.Y = -adder.Y; - auto sp = PlayerList[nLocalPlayer].pActor->int_pos() + vec3_t({ vdx, vax, 0 }); + auto sp = PlayerList[nLocalPlayer].pActor->spr.pos + adder; creepy = GetSoundPos(sp); if ((vsi & 0x1ff) >= kMaxSounds || !soundEngine->isValidSoundId((vsi & 0x1ff) + 1))