Minor cleanup

pull/567/head
scrawl 10 years ago
parent 9d86e5b028
commit c819180aa1

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

@ -515,14 +515,8 @@ namespace MWScript
Interpreter::Type_Integer value = 0;
for (MWMechanics::Spells::TIterator iter (
ptr.getClass().getCreatureStats (ptr).getSpells().begin());
iter!=ptr.getClass().getCreatureStats (ptr).getSpells().end(); ++iter)
if (iter->first==id)
{
value = 1;
break;
}
if (ptr.getClass().getCreatureStats(ptr).getSpells().hasSpell(id))
value = 1;
runtime.push (value);
}

Loading…
Cancel
Save