mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
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:
+6
-4
@@ -6,8 +6,8 @@
|
|||||||
#ifdef PRECOMPILEDHEADERS
|
#ifdef PRECOMPILEDHEADERS
|
||||||
#include "Laptop All.h"
|
#include "Laptop All.h"
|
||||||
#else
|
#else
|
||||||
|
#include <math.h>
|
||||||
#include "ASD.h"
|
#include "ASD.h"
|
||||||
|
|
||||||
#include "strategic.h"
|
#include "strategic.h"
|
||||||
#include "WCheck.h"
|
#include "WCheck.h"
|
||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
@@ -54,6 +54,8 @@
|
|||||||
#include "Isometric Utils.h"
|
#include "Isometric Utils.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern INT32 ReadFieldByField( HWFILE hFile, PTR pDest, UINT32 uiFieldSize, UINT32 uiElementSize, UINT32 uiCurByteCount );
|
extern INT32 ReadFieldByField( HWFILE hFile, PTR pDest, UINT32 uiFieldSize, UINT32 uiElementSize, UINT32 uiCurByteCount );
|
||||||
|
|
||||||
extern INT32 giReinforcementPool;
|
extern INT32 giReinforcementPool;
|
||||||
@@ -1016,7 +1018,7 @@ void EnemyHeliSAMCheck( INT16 id )
|
|||||||
samcth = (samcth * pSAMStrategicMap->bSAMCondition) / 100.0f;
|
samcth = (samcth * pSAMStrategicMap->bSAMCondition) / 100.0f;
|
||||||
|
|
||||||
// determine distance from SAM to heli
|
// 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
|
// distance penalty
|
||||||
samcth = (samcth * (100.0f - 8 * distance)) / 100.0f;
|
samcth = (samcth * (100.0f - 8 * distance)) / 100.0f;
|
||||||
@@ -1135,8 +1137,8 @@ void EnemyHeliMANPADSCheck( INT16 id )
|
|||||||
samcth = (samcth * (*pObj)[0]->data.objectStatus) / 100.0f;
|
samcth = (samcth * (*pObj)[0]->data.objectStatus) / 100.0f;
|
||||||
|
|
||||||
// determine distance from SAM to heli
|
// 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
|
// distance penalty
|
||||||
samcth = (samcth * (100.0f - 20 * distance)) / 100.0f;
|
samcth = (samcth * (100.0f - 20 * distance)) / 100.0f;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user