Fixed compilation error in VS 2005

- Missing "include <math.h>" in ASD.cpp
- Missing cast argument to FLOAT inside sqrt() function

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8021 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2016-01-15 08:09:52 +00:00
parent 3ce0e04a79
commit b430965027
+6 -4
View File
@@ -6,8 +6,8 @@
#ifdef PRECOMPILEDHEADERS
#include "Laptop All.h"
#else
#include <math.h>
#include "ASD.h"
#include "strategic.h"
#include "WCheck.h"
#include "Utilities.h"
@@ -54,6 +54,8 @@
#include "Isometric Utils.h"
#endif
extern INT32 ReadFieldByField( HWFILE hFile, PTR pDest, UINT32 uiFieldSize, UINT32 uiElementSize, UINT32 uiCurByteCount );
extern INT32 giReinforcementPool;
@@ -1016,7 +1018,7 @@ void EnemyHeliSAMCheck( INT16 id )
samcth = (samcth * pSAMStrategicMap->bSAMCondition) / 100.0f;
// determine distance from SAM to heli
FLOAT distance = sqrt( abs( heli_x - gpSamSectorX[ubControllingSAM - 1] ) * abs( heli_x - gpSamSectorX[ubControllingSAM - 1] ) + abs( heli_y - gpSamSectorY[ubControllingSAM - 1] ) * abs( heli_y - gpSamSectorY[ubControllingSAM - 1] ) );
FLOAT distance = sqrt(FLOAT(abs( heli_x - gpSamSectorX[ubControllingSAM - 1] ) * abs( heli_x - gpSamSectorX[ubControllingSAM - 1] ) + abs( heli_y - gpSamSectorY[ubControllingSAM - 1] ) * abs( heli_y - gpSamSectorY[ubControllingSAM - 1] ) ));
// distance penalty
samcth = (samcth * (100.0f - 8 * distance)) / 100.0f;
@@ -1135,8 +1137,8 @@ void EnemyHeliMANPADSCheck( INT16 id )
samcth = (samcth * (*pObj)[0]->data.objectStatus) / 100.0f;
// determine distance from SAM to heli
FLOAT distance = sqrt( abs( heli_x - pSoldier->sSectorX ) * abs( heli_x - pSoldier->sSectorX ) + abs( heli_y - pSoldier->sSectorY ) * abs( heli_y - pSoldier->sSectorY ) );
FLOAT distance = sqrt(FLOAT(abs( heli_x - pSoldier->sSectorX ) * abs( heli_x - pSoldier->sSectorX ) + abs( heli_y - pSoldier->sSectorY ) * abs( heli_y - pSoldier->sSectorY ) ));
// distance penalty
samcth = (samcth * (100.0f - 20 * distance)) / 100.0f;