From 52f6a2ec7b94beed468088be425ee6e6558ce401 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sun, 24 Aug 2014 11:58:08 +0200 Subject: [PATCH] remote local variable access was always using variable with index 1 instead of the index specified by the access request (Fixes #1739) --- apps/openmw/mwscript/interpretercontext.cpp | 2 +- components/compiler/locals.hpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwscript/interpretercontext.cpp b/apps/openmw/mwscript/interpretercontext.cpp index 121b07e34a..e401318d66 100644 --- a/apps/openmw/mwscript/interpretercontext.cpp +++ b/apps/openmw/mwscript/interpretercontext.cpp @@ -111,7 +111,7 @@ namespace MWScript const std::string& name, char type) const { int index = MWBase::Environment::get().getScriptManager()->getLocals (scriptId). - search (type, name); + searchIndex (type, name); if (index!=-1) return index; diff --git a/components/compiler/locals.hpp b/components/compiler/locals.hpp index cf7899b5ce..1b2ae60426 100644 --- a/components/compiler/locals.hpp +++ b/components/compiler/locals.hpp @@ -15,8 +15,6 @@ namespace Compiler std::vector mLongs; std::vector mFloats; - int searchIndex (char type, const std::string& name) const; - std::vector& get (char type); public: @@ -27,9 +25,11 @@ namespace Compiler int getIndex (const std::string& name) const; ///< return index for local variable \a name (-1: does not exist). + bool search (char type, const std::string& name) const; + /// Return index for local variable \a name of type \a type (-1: variable does not /// exit). - bool search (char type, const std::string& name) const; + int searchIndex (char type, const std::string& name) const; const std::vector& get (char type) const;