From 9de2922d22c310ae41a6d80ae5374bc4e6296c2f Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 11 Feb 2014 13:56:56 +0100 Subject: [PATCH] fixed case problem in remote member variable access --- apps/openmw/mwscript/scriptmanagerimp.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwscript/scriptmanagerimp.cpp b/apps/openmw/mwscript/scriptmanagerimp.cpp index 6862b9f830..11e094a843 100644 --- a/apps/openmw/mwscript/scriptmanagerimp.cpp +++ b/apps/openmw/mwscript/scriptmanagerimp.cpp @@ -7,12 +7,15 @@ #include #include -#include "../mwworld/esmstore.hpp" + +#include #include #include #include +#include "../mwworld/esmstore.hpp" + #include "extensions.hpp" namespace MWScript @@ -140,15 +143,17 @@ namespace MWScript Compiler::Locals& ScriptManager::getLocals (const std::string& name) { + std::string name2 = Misc::StringUtils::lowerCase (name); + { - ScriptCollection::iterator iter = mScripts.find (name); + ScriptCollection::iterator iter = mScripts.find (name2); if (iter!=mScripts.end()) return iter->second.second; } { - std::map::iterator iter = mOtherLocals.find (name); + std::map::iterator iter = mOtherLocals.find (name2); if (iter!=mOtherLocals.end()) return iter->second; @@ -156,7 +161,7 @@ namespace MWScript Compiler::Locals locals; - if (const ESM::Script *script = mStore.get().find (name)) + if (const ESM::Script *script = mStore.get().find (name2)) { int index = 0; @@ -170,7 +175,7 @@ namespace MWScript locals.declare ('f', script->mVarNames[index++]); std::map::iterator iter = - mOtherLocals.insert (std::make_pair (name, locals)).first; + mOtherLocals.insert (std::make_pair (name2, locals)).first; return iter->second; }