From f4a218285ff3fb5a29a1e3887055f16f04f8ded7 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Thu, 6 Feb 2025 14:19:34 +0000 Subject: [PATCH] Fix display of remaining spell duration for creatures --- client/battle/BattleInterfaceClasses.cpp | 2 +- client/windows/CCreatureWindow.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/battle/BattleInterfaceClasses.cpp b/client/battle/BattleInterfaceClasses.cpp index 1f57228da..5240737d5 100644 --- a/client/battle/BattleInterfaceClasses.cpp +++ b/client/battle/BattleInterfaceClasses.cpp @@ -691,7 +691,7 @@ void StackInfoBasicPanel::initializeData(const CStack * stack) if (spellBonuses->empty()) throw std::runtime_error("Failed to find effects for spell " + effect.toSpell()->getJsonKey()); - int duration = spellBonuses->front()->duration; + int duration = spellBonuses->front()->turnsRemain; icons.push_back(std::make_shared(AnimationPath::builtin("SpellInt"), effect + 1, 0, firstPos.x + offset.x * printed, firstPos.y + offset.y * printed)); if(settings["general"]["enableUiEnhancements"].Bool()) diff --git a/client/windows/CCreatureWindow.cpp b/client/windows/CCreatureWindow.cpp index e86bbf864..8973c19f9 100644 --- a/client/windows/CCreatureWindow.cpp +++ b/client/windows/CCreatureWindow.cpp @@ -238,7 +238,7 @@ CStackWindow::ActiveSpellsSection::ActiveSpellsSection(CStackWindow * owner, int if (spellBonuses->empty()) throw std::runtime_error("Failed to find effects for spell " + effect.toSpell()->getJsonKey()); - int duration = spellBonuses->front()->duration; + int duration = spellBonuses->front()->turnsRemain; boost::replace_first(spellText, "%d", std::to_string(duration)); spellIcons.push_back(std::make_shared(AnimationPath::builtin("SpellInt"), effect + 1, 0, firstPos.x + offset.x * printed, firstPos.y + offset.y * printed));