From 8fb00461364df79b3c968799da975556941891b5 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 10 Jan 2018 20:29:20 +0100 Subject: [PATCH] Fix #6990: Scenery not correctly marked as available --- src/openrct2/rct2/RCT2.h | 4 +++- src/openrct2/rct2/S6Importer.cpp | 3 +-- src/openrct2/scenario/Scenario.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 600d2d1406..6fc3a62f17 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -36,7 +36,9 @@ #define RCT2_MAX_ANIMATED_OBJECTS 2000 #define RCT2_MAX_RESEARCHED_RIDE_TYPE_QUADS 8 // With 32 bits per uint32, this means there is room for 256 types. #define RCT2_MAX_RESEARCHED_RIDE_ENTRY_QUADS 8 // With 32 bits per uint32, this means there is room for 256 entries. -#define RCT2_MAX_RESEARCHED_SCENERY_ITEM_QUADS 56 // With 32 bits per uint32, this means there is room for 1792 items. +#define RCT2_MAX_RESEARCHED_SCENERY_ITEM_QUADS 56 +#define RCT2_MAX_RESEARCHED_SCENERY_ITEMS (RCT2_MAX_RESEARCHED_SCENERY_ITEM_QUADS * 32) // There are 32 bits per quad. + typedef struct rct2_install_info { diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index dee7b4f78c..23f51bcb75 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -236,7 +236,6 @@ public: // pad_01357400 ImportResearchedRideTypes(); ImportResearchedRideEntries(); - ImportResearchedSceneryItems(); // _s6.researched_track_types_a // _s6.researched_track_types_b @@ -733,7 +732,7 @@ public: { set_all_scenery_items_not_invented(); - for (uint16 sceneryEntryIndex = 0; sceneryEntryIndex < RCT2_MAX_RESEARCHED_SCENERY_ITEM_QUADS; sceneryEntryIndex++) + for (uint16 sceneryEntryIndex = 0; sceneryEntryIndex < RCT2_MAX_RESEARCHED_SCENERY_ITEMS; sceneryEntryIndex++) { sint32 quadIndex = sceneryEntryIndex >> 5; sint32 bitIndex = sceneryEntryIndex & 0x1F; diff --git a/src/openrct2/scenario/Scenario.h b/src/openrct2/scenario/Scenario.h index f91e4d3b1d..1ccb163323 100644 --- a/src/openrct2/scenario/Scenario.h +++ b/src/openrct2/scenario/Scenario.h @@ -151,7 +151,7 @@ typedef struct rct_s6_data { uint8 security_colour; // Ignored in scenario - uint32 researched_scenery_items[56]; + uint32 researched_scenery_items[RCT2_MAX_RESEARCHED_SCENERY_ITEM_QUADS]; // SC6[9] uint16 park_rating;