From af04fe4b539b01a8e36fa5467697dd90c3c70113 Mon Sep 17 00:00:00 2001 From: Flugente Date: Fri, 3 Jul 2020 23:18:15 +0000 Subject: [PATCH] Fix: killing Doreen after having already convinced her to leave peacefully does not fully remove the loyalty gain for the peaceful solution, despite that being intended git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8835 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Overhead.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index 9caf4786..54d191bf 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -3811,9 +3811,16 @@ void HandleNPCTeamMemberDeath( SOLDIERTYPE *pSoldierOld ) // Doreen's dead if ( CheckFact( FACT_DOREEN_HAD_CHANGE_OF_HEART, 0 ) ) { + // Flugente: if we want to remove the previous bonus, we have to take the town sentiment into account, which is accounted differently when decrementing or incrementing + UINT32 loyaltychange = LOYALTY_BONUS_CHILDREN_FREED_DOREEN_SPARED; + loyaltychange *= ( 5 * gubTownRebelSentiment[DRASSEN] ) * ( 5 * gubTownRebelSentiment[DRASSEN] ); + loyaltychange /= 100 * 100; + // tsk tsk, player killed her after getting her to reconsider, lose the bonus for sparing her - DecrementTownLoyalty( DRASSEN, LOYALTY_BONUS_CHILDREN_FREED_DOREEN_SPARED ); - } // then get the points for freeing the kids though killing her + DecrementTownLoyalty( DRASSEN, loyaltychange ); + } + + // then get the points for freeing the kids though killing her IncrementTownLoyalty( DRASSEN, LOYALTY_BONUS_CHILDREN_FREED_DOREEN_KILLED ); // set the fact true so we have a universal check for whether the kids can go SetFactTrue( FACT_DOREEN_HAD_CHANGE_OF_HEART );