From 42e46b9929fcea28b304b5ec4503462afba9a409 Mon Sep 17 00:00:00 2001 From: Nyel <41634901+Nyedson@users.noreply.github.com> Date: Fri, 23 Feb 2024 09:33:27 -0300 Subject: [PATCH] fix: remove mount when dying (#2258) Fix #2225 --------- Co-authored-by: GitHub Actions --- src/creatures/players/player.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/creatures/players/player.cpp b/src/creatures/players/player.cpp index 011d762e57a..7cf6b6bcaf3 100644 --- a/src/creatures/players/player.cpp +++ b/src/creatures/players/player.cpp @@ -2669,6 +2669,11 @@ BlockType_t Player::blockHit(std::shared_ptr attacker, CombatType_t co } void Player::death(std::shared_ptr lastHitCreature) { + if (!g_configManager().getBoolean(TOGGLE_MOUNT_IN_PZ, __FUNCTION__) && isMounted()) { + dismount(); + g_game().internalCreatureChangeOutfit(getPlayer(), defaultOutfit); + } + loginPosition = town->getTemplePosition(); g_game().sendSingleSoundEffect(static_self_cast()->getPosition(), sex == PLAYERSEX_FEMALE ? SoundEffect_t::HUMAN_FEMALE_DEATH : SoundEffect_t::HUMAN_MALE_DEATH, getPlayer());