From e23a32c44ffe584773a3d8a53d7d9bd0a99bc640 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Mon, 13 Oct 2014 15:26:47 +0200 Subject: [PATCH] some cleanup --- apps/opencs/model/world/scriptcontext.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/apps/opencs/model/world/scriptcontext.cpp b/apps/opencs/model/world/scriptcontext.cpp index 07031d39c..6d97d75ce 100644 --- a/apps/opencs/model/world/scriptcontext.cpp +++ b/apps/opencs/model/world/scriptcontext.cpp @@ -55,19 +55,16 @@ std::pair CSMWorld::ScriptContext::getMemberType (const std::string& if (index!=-1) { // Referenceable found. - int columnIndex = mData.getReferenceables().searchColumnIndex (Columns::ColumnId_Script); + int columnIndex = mData.getReferenceables().findColumnIndex (Columns::ColumnId_Script); - if (columnIndex!=-1) + id2 = Misc::StringUtils::lowerCase (mData.getReferenceables(). + getData (index, columnIndex).toString().toUtf8().constData()); + + if (!id2.empty()) { - id2 = Misc::StringUtils::lowerCase (mData.getReferenceables(). - getData (index, columnIndex).toString().toUtf8().constData()); - - if (!id2.empty()) - { - // Referenceable has a script -> use it. - index = mData.getScripts().searchId (id2); - reference = true; - } + // Referenceable has a script -> use it. + index = mData.getScripts().searchId (id2); + reference = true; } } }