diff --git a/source/exhumed/src/player.cpp b/source/exhumed/src/player.cpp index cfb34ce2e..f417cf09a 100644 --- a/source/exhumed/src/player.cpp +++ b/source/exhumed/src/player.cpp @@ -109,7 +109,7 @@ short nPlayerViewSect[kMaxPlayers]; short nPlayerFloorSprite[kMaxPlayers]; PlayerSave sPlayerSave[kMaxPlayers]; int totalvel[kMaxPlayers] = { 0 }; -int16_t eyelevel[kMaxPlayers]; +int16_t eyelevel[kMaxPlayers], oeyelevel[kMaxPlayers]; short nNetStartSprite[kMaxPlayers] = { 0 }; short nStandHeight; @@ -770,7 +770,7 @@ void RestartPlayer(short nPlayer) } nPlayerGrenade[nPlayer] = -1; - eyelevel[nPlayer] = -14080; + oeyelevel[nPlayer] = eyelevel[nPlayer] = -14080; dVertPan[nPlayer] = 0; nTemperature[nPlayer] = 0; @@ -881,7 +881,7 @@ void StartDeathSeq(int nPlayer, int nVal) StopFiringWeapon(nPlayer); PlayerList[nPlayer].q16ohoriz = PlayerList[nPlayer].q16horiz = nVertPan[nPlayer] = F16(92); - eyelevel[nPlayer] = -14080; + oeyelevel[nPlayer] = eyelevel[nPlayer] = -14080; nPlayerInvisible[nPlayer] = 0; dVertPan[nPlayer] = 15; @@ -1050,6 +1050,7 @@ void FuncPlayer(int pA, int nDamage, int nRun) PlayerList[nPlayer].opos = sprite[nPlayerSprite].pos; PlayerList[nPlayer].q16oangle = PlayerList[nPlayer].q16angle; PlayerList[nPlayer].q16ohoriz = PlayerList[nPlayer].q16horiz; + oeyelevel[nPlayer] = eyelevel[nPlayer]; switch (nMessage) { diff --git a/source/exhumed/src/player.h b/source/exhumed/src/player.h index 6eb0f8788..99e866cb2 100644 --- a/source/exhumed/src/player.h +++ b/source/exhumed/src/player.h @@ -89,7 +89,7 @@ extern short nPlayerClip[]; extern short bobangle; extern int totalvel[]; -extern short eyelevel[]; +extern int16_t eyelevel[], oeyelevel[]; extern short nNetStartSprite[kMaxPlayers]; extern short nNetStartSprites; diff --git a/source/exhumed/src/view.cpp b/source/exhumed/src/view.cpp index e5fa5e7cf..ca91b5f86 100644 --- a/source/exhumed/src/view.cpp +++ b/source/exhumed/src/view.cpp @@ -406,7 +406,8 @@ void DrawView(int smoothRatio) { playerX = interpolate16(PlayerList[nLocalPlayer].opos.x, sprite[nPlayerSprite].x, smoothRatio); playerY = interpolate16(PlayerList[nLocalPlayer].opos.y, sprite[nPlayerSprite].y, smoothRatio); - playerZ = interpolate16(PlayerList[nLocalPlayer].opos.z, sprite[nPlayerSprite].z, smoothRatio) + eyelevel[nLocalPlayer]; + playerZ = interpolate16(PlayerList[nLocalPlayer].opos.z, sprite[nPlayerSprite].z, smoothRatio) + + interpolate16(oeyelevel[nLocalPlayer], eyelevel[nLocalPlayer], smoothRatio); nSector = nPlayerViewSect[nLocalPlayer]; nAngle = q16angle_interpolate16(PlayerList[nLocalPlayer].q16oangle, PlayerList[nLocalPlayer].q16angle, smoothRatio);