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
This commit is contained in:
Flugente
2020-07-03 23:18:15 +00:00
parent 000de06890
commit af04fe4b53
+9 -2
View File
@@ -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 );