Missing const, thanks to jeaye

actorid
scrawl 11 years ago
parent afafaf73e8
commit 6f3d737498

@ -120,7 +120,7 @@ namespace MWGui
MWBase::Environment::get().getWorld ()->getStore ().get<ESM::MagicEffect>().find(effectIt->mEffectID);
MagicEffectInfo effectInfo;
if (it->second.mName != "")
if (!it->second.mName.empty())
effectInfo.mSource = it->second.mName;
else
effectInfo.mSource = getSpellDisplayName(it->first);

@ -343,9 +343,9 @@ namespace MWMechanics
return mLastHitObject;
}
bool CreatureStats::canUsePower(const std::string &power)
bool CreatureStats::canUsePower(const std::string &power) const
{
std::map<std::string, MWWorld::TimeStamp>::iterator it = mUsedPowers.find(power);
std::map<std::string, MWWorld::TimeStamp>::const_iterator it = mUsedPowers.find(power);
if (it == mUsedPowers.end() || it->second + 24 <= MWBase::Environment::get().getWorld()->getTimeStamp())
return true;
else

@ -49,7 +49,7 @@ namespace MWMechanics
public:
CreatureStats();
bool canUsePower (const std::string& power);
bool canUsePower (const std::string& power) const;
void usePower (const std::string& power);
const Stat<int> & getAttribute(int index) const;

@ -2030,7 +2030,7 @@ namespace MWWorld
stats.setAttackingOrSpell(false);
std::string selectedSpell = stats.getSpells().getSelectedSpell();
std::string sourceName = "";
std::string sourceName;
if (!selectedSpell.empty())
{
const ESM::Spell* spell = getStore().get<ESM::Spell>().search(selectedSpell);

Loading…
Cancel
Save