Prevent overflow for planet weight when scanning a planet.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2893 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
Changes towards version 0.7:
|
Changes towards version 0.7:
|
||||||
|
- Prevent overflow for planet weight when scanning a planet
|
||||||
|
- from Benjamin Alan Weaver
|
||||||
- Don't set _POSIX_THREAD_SAFE_FUNCTIONS - SvdB
|
- Don't set _POSIX_THREAD_SAFE_FUNCTIONS - SvdB
|
||||||
- Support for Windows CE. - SvdB with Pavel Chernikov
|
- Support for Windows CE. - SvdB with Pavel Chernikov
|
||||||
- Added support to the unix build system for explicitely specifying the name
|
- Added support to the unix build system for explicitely specifying the name
|
||||||
|
|||||||
@@ -301,7 +301,7 @@ PrintCoarseScanPC (void)
|
|||||||
PrintScanTitlePC (&t, &r, GAME_STRING (ORBITSCAN_STRING_BASE + 11),
|
PrintScanTitlePC (&t, &r, GAME_STRING (ORBITSCAN_STRING_BASE + 11),
|
||||||
RIGHT_SIDE_BASELINE_X_PC); // "Mass: "
|
RIGHT_SIDE_BASELINE_X_PC); // "Mass: "
|
||||||
val = pSolarSysState->SysInfo.PlanetInfo.PlanetRadius;
|
val = pSolarSysState->SysInfo.PlanetInfo.PlanetRadius;
|
||||||
val = (val * val * val / 100L
|
val = ((DWORD) val * (DWORD) val * (DWORD) val / 100L
|
||||||
* pSolarSysState->SysInfo.PlanetInfo.PlanetDensity
|
* pSolarSysState->SysInfo.PlanetInfo.PlanetDensity
|
||||||
+ ((100L * 100L) >> 1)) / (100L * 100L);
|
+ ((100L * 100L) >> 1)) / (100L * 100L);
|
||||||
if (val == 0)
|
if (val == 0)
|
||||||
@@ -522,7 +522,7 @@ PrintCoarseScan3DO (void)
|
|||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
t.pStr = buf;
|
t.pStr = buf;
|
||||||
val = pSolarSysState->SysInfo.PlanetInfo.PlanetRadius;
|
val = pSolarSysState->SysInfo.PlanetInfo.PlanetRadius;
|
||||||
val = (val * val * val / 100L
|
val = ((DWORD) val * (DWORD) val * (DWORD) val / 100L
|
||||||
* pSolarSysState->SysInfo.PlanetInfo.PlanetDensity
|
* pSolarSysState->SysInfo.PlanetInfo.PlanetDensity
|
||||||
+ ((100L * 100L) >> 1)) / (100L * 100L);
|
+ ((100L * 100L) >> 1)) / (100L * 100L);
|
||||||
if (val == 0)
|
if (val == 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user