From a288b2e60ce862442ffc5d3d334719b5f86ce88b Mon Sep 17 00:00:00 2001 From: Flugente Date: Fri, 18 Jun 2021 18:40:31 +0000 Subject: [PATCH] Fix: load map modifications before loading items, as altered structures can change items visibility git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9086 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Tactical Save.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Tactical/Tactical Save.cpp b/Tactical/Tactical Save.cpp index 4e5b679a9..db537be99 100644 --- a/Tactical/Tactical Save.cpp +++ b/Tactical/Tactical Save.cpp @@ -1295,6 +1295,14 @@ BOOLEAN LoadCurrentSectorsInformationFromTempItemsFile() #endif //if we are in an above ground sector + //If there is a map modifications file, load the data from the temp file + if ( DoesTempFileExistsForMap( SF_MAP_MODIFICATIONS_TEMP_FILE_EXISTS, gWorldSectorX, gWorldSectorY, gbWorldSectorZ ) ) + { + fUsedTempFile = TRUE; + if ( !LoadAllMapChangesFromMapTempFileAndApplyThem() ) + return( FALSE ); + } + //If there is a file, load in the Items array if( DoesTempFileExistsForMap( SF_ITEM_TEMP_FILE_EXISTS, gWorldSectorX, gWorldSectorY, gbWorldSectorZ ) ) { @@ -1311,14 +1319,6 @@ BOOLEAN LoadCurrentSectorsInformationFromTempItemsFile() return( FALSE ); } - //If there is a map modifications file, load the data from the temp file - if( DoesTempFileExistsForMap( SF_MAP_MODIFICATIONS_TEMP_FILE_EXISTS, gWorldSectorX, gWorldSectorY, gbWorldSectorZ ) ) - { - fUsedTempFile = TRUE; - if( !LoadAllMapChangesFromMapTempFileAndApplyThem( ) ) - return( FALSE ); - } - //if there is a door table temp file, load the data from the temp file if( DoesTempFileExistsForMap( SF_DOOR_TABLE_TEMP_FILES_EXISTS, gWorldSectorX, gWorldSectorY, gbWorldSectorZ ) ) {