From 4ba64556bfb3a576015c5714a4e0f3a096c0263b Mon Sep 17 00:00:00 2001 From: Flugente Date: Thu, 22 Jan 2015 21:13:30 +0000 Subject: [PATCH] Fix: no morale/loyalty penalty if a killed civilian was a member of a group git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7721 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Strategic Town Loyalty.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Strategic/Strategic Town Loyalty.cpp b/Strategic/Strategic Town Loyalty.cpp index b09dfc982..74bc2d6f5 100644 --- a/Strategic/Strategic Town Loyalty.cpp +++ b/Strategic/Strategic Town Loyalty.cpp @@ -710,15 +710,12 @@ void HandleMurderOfCivilian( SOLDIERTYPE *pSoldier, BOOLEAN fIntentional ) } } + // Flugente: if a civilian's group has Loyalty set to 0, there will be no morale penalty/loyalty change if he is killed. Pretty odd, but at least not as bugged as it was before. // if civilian belongs to a civilian group - if ( pSoldier->ubCivilianGroup != NON_CIV_GROUP ) + if ( pSoldier->ubCivilianGroup != NON_CIV_GROUP && pSoldier->ubCivilianGroup < NUM_CIV_GROUPS ) { - //New Group by Jazz - for( iCounter2 = REBEL_CIV_GROUP; iCounter2 < NUM_CIV_GROUPS; iCounter2++ ) - { - if (zCivGroupName[iCounter2].Loyalty == FALSE) - return; - } + if ( !zCivGroupName[pSoldier->ubCivilianGroup].Loyalty ) + return; } /*