From 34266ff4c7162d84bc3ff9212a1ad1f2650bf36a Mon Sep 17 00:00:00 2001 From: KPhoenix <68359262+kphoenix137@users.noreply.github.com> Date: Sat, 15 Jan 2022 14:24:19 -0500 Subject: [PATCH] Show correct death animation (#3953) Shows death animation based on what armor you are wearing while dying. Dropping items on death results in showing light armor animation. --- Source/msg.cpp | 2 +- Source/multi.cpp | 2 +- Source/player.cpp | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Source/msg.cpp b/Source/msg.cpp index 0f4b04c90..88263bc9a 100644 --- a/Source/msg.cpp +++ b/Source/msg.cpp @@ -1670,7 +1670,7 @@ DWORD OnPlayerJoinLevel(const TCmd *pCmd, int pnum) if ((player._pHitPoints >> 6) > 0) { StartStand(pnum, Direction::South); } else { - player._pgfxnum = 0; + player._pgfxnum &= ~0xF; player._pmode = PM_DEATH; NewPlrAnim(player, player_graphic::Death, Direction::South, player._pDFrames, 1); player.AnimInfo.CurrentFrame = player.AnimInfo.NumberOfFrames - 1; diff --git a/Source/multi.cpp b/Source/multi.cpp index 87aa36c3c..ba0550814 100644 --- a/Source/multi.cpp +++ b/Source/multi.cpp @@ -823,7 +823,7 @@ void recv_plrinfo(int pnum, const TCmdPlrInfoHdr &header, bool recv) return; } - player._pgfxnum = 0; + player._pgfxnum &= ~0xF; player._pmode = PM_DEATH; NewPlrAnim(player, player_graphic::Death, Direction::South, player._pDFrames, 1); player.AnimInfo.CurrentFrame = player.AnimInfo.NumberOfFrames - 1; diff --git a/Source/player.cpp b/Source/player.cpp index dfe62943e..4cc3730a8 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -2377,7 +2377,7 @@ void InitPlayerGFX(Player &player) ResetPlayerGFX(player); if (player._pHitPoints >> 6 == 0) { - player._pgfxnum = 0; + player._pgfxnum &= ~0xF; LoadPlrGFX(player, player_graphic::Death); return; } @@ -3108,7 +3108,10 @@ StartPlayerKill(int pnum, int earflag) player.Say(HeroSpeech::AuughUh); if (player._pgfxnum != 0) { - player._pgfxnum = 0; + if (diablolevel || earflag != 0) + player._pgfxnum &= ~0xF; + else + player._pgfxnum = 0; ResetPlayerGFX(player); SetPlrAnims(player); }