1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 23:23:52 +00:00

Fix potential case smashing issue

This commit is contained in:
scrawl 2015-10-05 15:41:07 +02:00
parent b4132faaea
commit 77cb438714

View file

@ -312,7 +312,7 @@ namespace MWMechanics
bool Spells::canUsePower(const std::string &power) const bool Spells::canUsePower(const std::string &power) const
{ {
std::map<std::string, MWWorld::TimeStamp>::const_iterator it = mUsedPowers.find(power); std::map<std::string, MWWorld::TimeStamp>::const_iterator it = mUsedPowers.find(Misc::StringUtils::lowerCase(power));
if (it == mUsedPowers.end() || it->second + 24 <= MWBase::Environment::get().getWorld()->getTimeStamp()) if (it == mUsedPowers.end() || it->second + 24 <= MWBase::Environment::get().getWorld()->getTimeStamp())
return true; return true;
else else
@ -321,7 +321,7 @@ namespace MWMechanics
void Spells::usePower(const std::string &power) void Spells::usePower(const std::string &power)
{ {
mUsedPowers[power] = MWBase::Environment::get().getWorld()->getTimeStamp(); mUsedPowers[Misc::StringUtils::lowerCase(power)] = MWBase::Environment::get().getWorld()->getTimeStamp();
} }
void Spells::readState(const ESM::SpellState &state) void Spells::readState(const ESM::SpellState &state)