Fix: possible overflow when creating building (by asm-debacle)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8020 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2016-01-11 18:06:21 +00:00
parent f6a3b481e5
commit 3ce0e04a79
+3 -3
View File
@@ -552,11 +552,11 @@ BUILDING * GenerateBuilding( INT32 sDesiredSpot )
// something that has gone pear shaped
if(uiLoop2 >= WORLD_MAX)
{
UINT8 x = 0;
UINT8 y = 0;
INT32 x = 0;
INT32 y = 0;
while((sDesiredSpot - ((y + 1) * WORLD_COLS)) >= 0)
{
y++;
++y;
}
x = sDesiredSpot - (y * WORLD_COLS);
DebugMsg (TOPIC_JA2,DBG_LEVEL_2,String( "113/UC Warning! Building Walk Algorithm has covered the entire map! Building %d located at [%d,%d] must be bogus.", ubBuildingID, x, y ));