From 291985c0224a5ee3a26dc2fbdb6c68fd99d7000b Mon Sep 17 00:00:00 2001 From: Flugente Date: Tue, 4 Nov 2014 20:37:42 +0000 Subject: [PATCH] ROOF_COLLAPSE controls whether roofs can be destroyed. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7647 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameSettings.cpp | 1 + GameSettings.h | 3 +++ TileEngine/Explosion Control.cpp | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/GameSettings.cpp b/GameSettings.cpp index 0bae2bd2..3fbc21d3 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -1660,6 +1660,7 @@ void LoadGameExternalOptions() //################# Tactical Fortification Settings ################## gGameExternalOptions.fFortificationAllowInHostileSector = iniReader.ReadBoolean("Tactical Fortification Settings", "FORTIFICATION_ALLOW_IN_HOSTILE_SECTOR", FALSE); + gGameExternalOptions.fRoofCollapse = iniReader.ReadBoolean( "Tactical Fortification Settings", "ROOF_COLLAPSE", TRUE ); //################# Tactical Food Settings ################## gGameExternalOptions.usFoodDigestionHourlyBaseFood = iniReader.ReadInteger("Tactical Food Settings", "FOOD_DIGESTION_HOURLY_BASE_FOOD", 20, 0, 250); diff --git a/GameSettings.h b/GameSettings.h index 1f9396ac..1ceaf20d 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -390,6 +390,9 @@ typedef struct // Flugente: fortification settings BOOLEAN fFortificationAllowInHostileSector; + // Flugente: can roofs collapse? + BOOLEAN fRoofCollapse; + // Flugente: food settings UINT16 usFoodDigestionHourlyBaseFood; UINT16 usFoodDigestionHourlyBaseDrink; diff --git a/TileEngine/Explosion Control.cpp b/TileEngine/Explosion Control.cpp index b846b3b9..aaf05728 100644 --- a/TileEngine/Explosion Control.cpp +++ b/TileEngine/Explosion Control.cpp @@ -6012,7 +6012,7 @@ BOOLEAN DamageRoof( INT32 sGridNo, INT16 sDamage ) void HandleRoofDestruction( INT32 sGridNo, INT16 sDamage ) { // only if there is significant damage done - if ( sDamage < 1 || TileIsOutOfBounds( sGridNo ) || !IsRoofPresentAtGridNo( sGridNo ) ) + if ( sDamage < 1 || !gGameExternalOptions.fRoofCollapse || TileIsOutOfBounds( sGridNo ) || !IsRoofPresentAtGridNo( sGridNo ) ) return; ApplyMapChangesToMapTempFile( TRUE );