From 76302328c22e39e7d472f97d8a57dc5dcdf949e1 Mon Sep 17 00:00:00 2001 From: Flugente Date: Sat, 4 Jul 2020 18:51:58 +0000 Subject: [PATCH] Don't check whether an explosion damaging a room pisses of civilians if there is no room to begin with git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8839 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- TileEngine/Explosion Control.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/TileEngine/Explosion Control.cpp b/TileEngine/Explosion Control.cpp index 59672974..75265649 100644 --- a/TileEngine/Explosion Control.cpp +++ b/TileEngine/Explosion Control.cpp @@ -5166,6 +5166,10 @@ void HandleBuldingDestruction( INT32 sGridNo, UINT8 ubOwner ) return; } + // no point doing this if this is not part of a room + if ( sGridNo == NOWHERE || !InARoom( sGridNo, NULL ) ) + return; + cnt = gTacticalStatus.Team[ CIV_TEAM ].bFirstID; for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; cnt++ ,pSoldier++ ) { @@ -5190,14 +5194,12 @@ void HandleBuldingDestruction( INT32 sGridNo, UINT8 ubOwner ) INT32 FindActiveTimedBomb( void ) { - UINT32 uiWorldBombIndex; - UINT32 uiTimeStamp; OBJECTTYPE * pObj; - uiTimeStamp = GetJA2Clock(); + //UINT32 uiTimeStamp = GetJA2Clock(); // Go through all the bombs in the world, and look for timed ones - for (uiWorldBombIndex = 0; uiWorldBombIndex < guiNumWorldBombs; uiWorldBombIndex++) + for ( UINT32 uiWorldBombIndex = 0; uiWorldBombIndex < guiNumWorldBombs; ++uiWorldBombIndex) { if (gWorldBombs[uiWorldBombIndex].fExists) { @@ -5218,10 +5220,8 @@ BOOLEAN ActiveTimedBombExists( void ) { return( FindActiveTimedBomb() != -1 ); } - else - { - return( FALSE ); - } + + return( FALSE ); } void RemoveAllActiveTimedBombs( void )