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

small tweak to getPlayerGold() method

This commit is contained in:
scrawl 2012-05-19 16:10:13 +02:00
parent 2a4c55f1ab
commit 92d9e070fb

View file

@ -21,6 +21,19 @@
#include "bookwindow.hpp"
#include "scrollwindow.hpp"
namespace
{
std::string toLower (const std::string& name)
{
std::string lowerCase;
std::transform (name.begin(), name.end(), std::back_inserter (lowerCase),
(int(*)(int)) std::tolower);
return lowerCase;
}
}
namespace MWGui
{
@ -236,7 +249,7 @@ namespace MWGui
for (MWWorld::ContainerStoreIterator it = invStore.begin();
it != invStore.end(); ++it)
{
if (MWWorld::Class::get(*it).getName(*it) == MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sGold")->str)
if (toLower(it->getCellRef().refID) == "gold_001")
return it->getRefData().getCount();
}
return 0;