Minor cleanup

openmw-36
scrawl 10 years ago
parent 9d86e5b028
commit c819180aa1

@ -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)

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

Loading…
Cancel
Save