mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-22 03:13:15 -04:00
Merge branch 'theimpossibletrap' into 'master'
Don't use ESM::Spell::mData::mCost directly See merge request OpenMW/openmw!4854
This commit is contained in:
commit
792e494335
@ -78,7 +78,7 @@ namespace MWGui
|
||||
toAdd->eventMouseWheel += MyGUI::newDelegate(this, &SpellBuyingWindow::onMouseWheel);
|
||||
toAdd->setUserString("ToolTipType", "Spell");
|
||||
toAdd->setUserString("Spell", spell.mId.serialize());
|
||||
toAdd->setUserString("SpellCost", std::to_string(spell.mData.mCost));
|
||||
toAdd->setUserString("SpellCost", "true");
|
||||
toAdd->eventMouseButtonClick += MyGUI::newDelegate(this, &SpellBuyingWindow::onSpellButtonClick);
|
||||
mSpellsWidgetMap.insert(std::make_pair(toAdd, spell.mId));
|
||||
if (price <= playerGold)
|
||||
|
@ -248,8 +248,7 @@ namespace MWGui
|
||||
info.text = "#{sSchool}: " + MyGUI::TextIterator::toTagsString(school->mName).asUTF8();
|
||||
}
|
||||
}
|
||||
auto cost = focus->getUserString("SpellCost");
|
||||
if (!cost.empty() && cost != "0")
|
||||
if (focus->getUserString("SpellCost") == "true")
|
||||
info.text
|
||||
+= MWGui::ToolTips::getValueString(MWMechanics::calcSpellCost(*spell), "#{sCastCost}");
|
||||
info.effects = std::move(effects);
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "../mwbase/world.hpp"
|
||||
|
||||
#include "creaturestats.hpp"
|
||||
#include "spellutil.hpp"
|
||||
|
||||
namespace MWMechanics
|
||||
{
|
||||
@ -89,7 +90,7 @@ namespace MWMechanics
|
||||
|
||||
const ESM::Spell* trapSpell
|
||||
= MWBase::Environment::get().getESMStore()->get<ESM::Spell>().find(trap.getCellRef().getTrap());
|
||||
int trapSpellPoints = trapSpell->mData.mCost;
|
||||
int trapSpellPoints = MWMechanics::calcSpellCost(*trapSpell);
|
||||
|
||||
float fTrapCostMult = MWBase::Environment::get()
|
||||
.getESMStore()
|
||||
|
Loading…
x
Reference in New Issue
Block a user