mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
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:
@@ -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 ));
|
||||
|
||||
Reference in New Issue
Block a user