From 910d62e4b84e701e4da58ac83e0d882804eb6c6f Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Fri, 14 Feb 2014 11:59:33 +0100 Subject: [PATCH] added missing implementation for CSMWorld::ScriptContext::getGlobalType --- apps/opencs/model/world/scriptcontext.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/apps/opencs/model/world/scriptcontext.cpp b/apps/opencs/model/world/scriptcontext.cpp index 1b3028159..2627c49f3 100644 --- a/apps/opencs/model/world/scriptcontext.cpp +++ b/apps/opencs/model/world/scriptcontext.cpp @@ -16,6 +16,20 @@ bool CSMWorld::ScriptContext::canDeclareLocals() const char CSMWorld::ScriptContext::getGlobalType (const std::string& name) const { + int index = mData.getGlobals().searchId (name); + + if (index!=-1) + { + switch (mData.getGlobals().getRecord (index).get().mValue.getType()) + { + case ESM::VT_Short: return 's'; + case ESM::VT_Long: return 'l'; + case ESM::VT_Float: return 'f'; + + default: return ' '; + } + } + return ' '; }