fix(Core/Player): Fix potion cooldown not ticking after combat ends (#25135)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
Co-authored-by: Treeston <treeston.mmoc@gmail.com>
This commit is contained in:
blinkysc
2026-03-20 09:40:55 -05:00
committed by GitHub
parent 48fa4d2856
commit 0464e90853
2 changed files with 11 additions and 0 deletions

View File

@@ -1826,6 +1826,7 @@ public:
uint32 GetLastPotionId() { return m_lastPotionId; }
void SetLastPotionId(uint32 item_id) { m_lastPotionId = item_id; }
void UpdatePotionCooldown(Spell* spell = nullptr);
void AtExitCombat() override;
void setResurrectRequestData(ObjectGuid guid, uint32 mapId, float X, float Y, float Z, uint32 health, uint32 mana)
{

View File

@@ -1545,6 +1545,16 @@ void Player::UpdatePvP(bool state, bool _override)
sScriptMgr->OnPlayerPVPFlagChange(this, state);
}
void Player::AtExitCombat()
{
Unit::AtExitCombat();
UpdatePotionCooldown();
if (IsClass(CLASS_DEATH_KNIGHT, CLASS_CONTEXT_ABILITY))
for (uint8 i = 0; i < MAX_RUNES; ++i)
SetGracePeriod(i, 0);
}
void Player::UpdatePotionCooldown(Spell* spell)
{
// no potion used i combat or still in combat