From eb15473d37ebee30efb73fb01fba23a1fa4b36e5 Mon Sep 17 00:00:00 2001 From: Flugente Date: Sun, 26 Oct 2014 00:20:29 +0000 Subject: [PATCH] Deconstructing the walls of a house will eventually cause it's roof to collapse. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7615 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Handle Items.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Tactical/Handle Items.cpp b/Tactical/Handle Items.cpp index bdcd5e99..a79cb00b 100644 --- a/Tactical/Handle Items.cpp +++ b/Tactical/Handle Items.cpp @@ -6972,6 +6972,15 @@ BOOLEAN RemoveFortification( INT32 sGridNo, SOLDIERTYPE *pSoldier, OBJECTTYPE *p // Remove old graphic ApplyMapChangesToMapTempFile( TRUE ); + // if this is a wall, check wether the roof will collapse. + // Yes, the player can damage himself by collapsing the roof of the house he is currently in. Such stupidity has to be punished. + if ( pStruct->fFlags & STRUCTURE_WALL ) + { + // this isn't an explosion, so the structural damage is moderate + HandleRoofDestruction( sGridNo, 50 ); + HandleRoofDestruction( pSoldier->sGridNo, 50 ); + } + RemoveStruct( sGridNo, pNode->usIndex ); if ( !GridNoIndoors( sGridNo ) && gTileDatabase[ usIndex ].uiFlags & HAS_SHADOW_BUDDY && gTileDatabase[ usIndex ].sBuddyNum != -1 )