From 539de4e83835c683755598d7178a03a23f35bb57 Mon Sep 17 00:00:00 2001 From: Shadooow Date: Sat, 19 Feb 2022 10:22:49 +0000 Subject: [PATCH] Fixed dead enemies after autoresolve sometimes being placed on non-walkable grids which, if they dropped any items, made such items inaccessible as well. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9305 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- TileEngine/Isometric Utils.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/TileEngine/Isometric Utils.cpp b/TileEngine/Isometric Utils.cpp index a89289c2..26bce355 100644 --- a/TileEngine/Isometric Utils.cpp +++ b/TileEngine/Isometric Utils.cpp @@ -1277,7 +1277,15 @@ INT16 MapY( INT32 sGridNo ) return( sYPos ); } - +bool GridNoOnWalkableWorldTile(INT32 sGridNo) +{ + MAP_ELEMENT *pMapElement = &(gpWorldLevelData[sGridNo]); + //Shadooow: as far as I know, Drassen Mine (tileset id 23) is the only map where the base land height isn't 0 + //if there are more, add them into this hardcoded check + UINT8 sDefaultTilesetLandHeight = giCurrentTilesetID == 23 ? 80 : 0; + //ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"GridNoOnWalkableWorldTile, tileset id: %i, gridno height level: %i", giCurrentTilesetID, pMapElement->sHeight); + return pMapElement->sHeight == sDefaultTilesetLandHeight; +} BOOLEAN GridNoOnVisibleWorldTile( INT32 sGridNo ) { @@ -1296,7 +1304,7 @@ BOOLEAN GridNoOnVisibleWorldTile( INT32 sGridNo ) if ( sWorldX >= 30 && sWorldX <= (gsTRX - gsTLX - 30) && sWorldY >= 20 && sWorldY <= (gsBLY - gsTLY - 10) ) #endif { - return( TRUE ); + return GridNoOnWalkableWorldTile(sGridNo); } return( FALSE );