1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-13 14:39:41 +00:00

Missing const, thanks to jeaye

This commit is contained in:
scrawl 2013-11-10 23:21:26 +01:00
parent afafaf73e8
commit 6f3d737498
4 changed files with 5 additions and 5 deletions

View file

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

View file

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

View file

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

View file

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