Missing xml data could lead to mine income always being 0 if playing with strategic disease.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7443 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2014-08-28 01:32:53 +00:00
parent 17fab7ba83
commit 011caf4eaf
+6
View File
@@ -715,6 +715,12 @@ FLOAT GetWorkforceEffectivenessWithDisease( INT8 bTownId, UINT8 usTeam )
// workforce effectivity in a sector is population minus cumulated effectivity loss of all infected, divided by entire population
val += (population - min( pSectorInfo->usInfected, population ) * pSectorInfo->fInfectionSeverity ) / population;
}
// if no population is here, then there is no part of te population that is not working, so retrun 1.0 here :-)
// this is basically a fix for players using this feature who have faulty xmls with population 0
else
{
val += 1.0f;
}
++sectors;
}