Bugfix for compiler errors in VS2008

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7393 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2014-08-13 15:54:54 +00:00
parent 9b8169cd58
commit 5cfda83df4
+3 -2
View File
@@ -18,6 +18,7 @@
#include "LaptopSave.h" #include "LaptopSave.h"
#include "strategic.h" #include "strategic.h"
#include "DynamicDialogue.h" #include "DynamicDialogue.h"
#include <math.h>
//GLOBALS //GLOBALS
DISEASE Disease[NUM_DISEASES]; DISEASE Disease[NUM_DISEASES];
@@ -270,7 +271,7 @@ void HandleDisease()
{ {
// infection is also possible by human contact // infection is also possible by human contact
UINT32 usChance = Disease[0].usInfectionChance[INFECTION_TYPE_CONTACT_HUMAN]; UINT32 usChance = Disease[0].usInfectionChance[INFECTION_TYPE_CONTACT_HUMAN];
UINT16 max = sqrt( min( lefttoinfect - newinfected, pSectorInfo->usInfected ) ); UINT16 max = sqrt( (FLOAT) min( lefttoinfect - newinfected, pSectorInfo->usInfected ) );
for ( UINT16 i = 0; i < max; ++i ) for ( UINT16 i = 0; i < max; ++i )
{ {
if ( Chance( usChance ) ) if ( Chance( usChance ) )
@@ -283,7 +284,7 @@ void HandleDisease()
// there is also the chance to be infected by bad food, sex, contact with animals etc. // there is also the chance to be infected by bad food, sex, contact with animals etc.
// For now, we assume this to be very rare events, so just add a small chance to be infected this way // For now, we assume this to be very rare events, so just add a small chance to be infected this way
FLOAT populationpercentage = (FLOAT)(lefttoinfect - newinfected) / (FLOAT)(population); FLOAT populationpercentage = (FLOAT)(lefttoinfect - newinfected) / (FLOAT)(population);
FLOAT basechance = sqrt( min( lefttoinfect, pSectorInfo->usInfected + newinfected ) ) * 0.5f; FLOAT basechance = sqrt( (FLOAT) min( lefttoinfect, pSectorInfo->usInfected + newinfected ) ) * 0.5f;
FLOAT chance_sex = Disease[0].usInfectionChance[INFECTION_TYPE_SEX] * basechance * populationpercentage; FLOAT chance_sex = Disease[0].usInfectionChance[INFECTION_TYPE_SEX] * basechance * populationpercentage;
FLOAT chance_corpse = 0; FLOAT chance_corpse = 0;