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
This commit is contained in:
Shadooow
2022-02-19 10:22:49 +00:00
parent 1c8b6a0f29
commit 539de4e838
+10 -2
View File
@@ -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 );