From f945d164af06595d5c1135d3c6abc279cc4d7a9a Mon Sep 17 00:00:00 2001 From: Flugente Date: Wed, 16 May 2018 21:54:16 +0000 Subject: [PATCH] Fix: Make sure MILITIA_VOLUNTEER_POOL_MULTIPLIER_FARM is not applied to farms inside towns git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8563 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Town Militia.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Strategic/Town Militia.cpp b/Strategic/Town Militia.cpp index c829fae46..66dd915d1 100644 --- a/Strategic/Town Militia.cpp +++ b/Strategic/Town Militia.cpp @@ -2112,13 +2112,7 @@ FLOAT CalcHourlyVolunteerGain() // not if the enemy controls this sector if ( StrategicMap[CALCULATE_STRATEGIC_INDEX( sX, sY )].fEnemyControlled ) continue; - - UINT8 sector = SECTOR( sX, sY ); - - // modifier increase for every farm we control - if ( IsSectorFarm( sX, sY ) ) - populationmodifier += gGameExternalOptions.dMilitiaVolunteerMultiplierFarm; - + UINT8 ubTownID = StrategicMap[CALCULATE_STRATEGIC_INDEX( sX, sY )].bNameId; if ( ubTownID != BLANK_SECTOR ) { @@ -2126,6 +2120,9 @@ FLOAT CalcHourlyVolunteerGain() loyalpopulation += gTownLoyalty[ubTownID].ubRating * population / 100; } + // modifier increase for every farm we control + else if ( IsSectorFarm( sX, sY ) ) + populationmodifier += gGameExternalOptions.dMilitiaVolunteerMultiplierFarm; } }