From 389f40ba3d679501fdc2ad3188ab6c50290bc2e6 Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Mon, 26 Nov 2018 15:51:36 +0000 Subject: [PATCH] Fix: flashbang effect in a building without flat roof git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8642 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- TileEngine/Buildings.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/TileEngine/Buildings.cpp b/TileEngine/Buildings.cpp index c300e1ec..94ebc5a3 100644 --- a/TileEngine/Buildings.cpp +++ b/TileEngine/Buildings.cpp @@ -608,7 +608,10 @@ BUILDING * FindBuilding( INT32 sGridNo ) BOOLEAN InBuilding( INT32 sGridNo ) { - if ( FindBuilding( sGridNo ) == NULL ) + // sevenfm: FindBuilding() only checks for buildings with flat roofs (those you can climb) + // since InBuilding() is used to determine flashbang effect, check also if tile is in a room and has any roof above + //if ( FindBuilding( sGridNo ) == NULL ) + if (FindBuilding(sGridNo) || InARoom(sGridNo, NULL) && FindStructure(sGridNo, STRUCTURE_ROOF)) { return( FALSE ); }