|
|
@ -127,13 +127,7 @@ namespace MWGui
|
|
|
|
bool SpellBuyingWindow::playerHasSpell(const std::string &id)
|
|
|
|
bool SpellBuyingWindow::playerHasSpell(const std::string &id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
|
|
|
MWMechanics::Spells& playerSpells = player.getClass().getCreatureStats (player).getSpells();
|
|
|
|
return player.getClass().getCreatureStats(player).getSpells().hasSpell(id);
|
|
|
|
for (MWMechanics::Spells::TIterator it = playerSpells.begin(); it != playerSpells.end(); ++it)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (Misc::StringUtils::ciEqual(id, it->first))
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SpellBuyingWindow::onSpellButtonClick(MyGUI::Widget* _sender)
|
|
|
|
void SpellBuyingWindow::onSpellButtonClick(MyGUI::Widget* _sender)
|
|
|
|