From eb1888a540cf21f263ec3ef5dc36b4ed88d6402e Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 2 Aug 2014 22:31:14 +0200 Subject: [PATCH] Fix GetPcRank and PcExpelled not accepting Faction IDs properly (Fixes #1709) --- apps/openmw/mwscript/statsextensions.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwscript/statsextensions.cpp b/apps/openmw/mwscript/statsextensions.cpp index 07d137ce2..7150704ca 100644 --- a/apps/openmw/mwscript/statsextensions.cpp +++ b/apps/openmw/mwscript/statsextensions.cpp @@ -637,8 +637,6 @@ namespace MWScript virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0) { - MWWorld::Ptr ptr = R()(runtime); - std::string factionID = ""; if(arg0 >0) { @@ -647,6 +645,8 @@ namespace MWScript } else { + MWWorld::Ptr ptr = R()(runtime); + if(ptr.getClass().getNpcStats(ptr).getFactionRanks().empty()) { factionID = ""; @@ -913,8 +913,6 @@ namespace MWScript virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0) { - MWWorld::Ptr ptr = R()(runtime); - std::string factionID = ""; if(arg0 >0 ) { @@ -923,6 +921,8 @@ namespace MWScript } else { + MWWorld::Ptr ptr = R()(runtime); + if(ptr.getClass().getNpcStats(ptr).getFactionRanks().empty()) { factionID = "";