mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
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:
@@ -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
|
// 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;
|
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;
|
++sectors;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user