From 028db21c8aa73e5889d964960c92619f9398e2f4 Mon Sep 17 00:00:00 2001 From: Allofich Date: Sat, 8 Oct 2016 21:18:38 +0900 Subject: [PATCH] Don't let disposition at end of dialogue be below 0 (Fixes #3584) --- apps/openmw/mwdialogue/dialoguemanagerimp.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp index 578b5b9a4..14210099f 100644 --- a/apps/openmw/mwdialogue/dialoguemanagerimp.cpp +++ b/apps/openmw/mwdialogue/dialoguemanagerimp.cpp @@ -448,6 +448,12 @@ namespace MWDialogue { MWBase::Environment::get().getWindowManager()->removeGuiMode(MWGui::GM_Dialogue); + // Clamp permanent disposition change so that final disposition doesn't go below 0 (could happen with intimidate) + + float curDisp = static_cast(MWBase::Environment::get().getMechanicsManager()->getDerivedDisposition(mActor, false)); + if (curDisp + mPermanentDispositionChange < 0) + mPermanentDispositionChange = -curDisp; + // Apply disposition change to NPC's base disposition if (mActor.getClass().isNpc()) {