mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 13:49:40 +00:00
Minor cleanup
This commit is contained in:
parent
9d86e5b028
commit
c819180aa1
2 changed files with 3 additions and 15 deletions
|
@ -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…
Reference in a new issue