From 84961d78434ca5a6651eb4d7565ed7ec1d8b6140 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 28 Apr 2014 15:30:57 +0200 Subject: [PATCH] Fixes #1254: PcRank should return first rank if not in the faction --- apps/openmw/mwscript/interpretercontext.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/openmw/mwscript/interpretercontext.cpp b/apps/openmw/mwscript/interpretercontext.cpp index 9a55b3dcf..b97be61e1 100644 --- a/apps/openmw/mwscript/interpretercontext.cpp +++ b/apps/openmw/mwscript/interpretercontext.cpp @@ -307,6 +307,11 @@ namespace MWScript if (it != ranks.end()) rank = it->second; + // If you are not in the faction, PcRank returns the first rank, for whatever reason. + // This is used by the dialogue when joining the Thieves Guild in Balmora. + if (rank == -1) + rank = 0; + const MWWorld::ESMStore &store = world->getStore(); const ESM::Faction *faction = store.get().find(factionId);