From 8e37ee26c9f70ab94291506ca6735346bc3bba2b Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Tue, 13 Mar 2018 20:48:16 +0100 Subject: [PATCH] Avoid warning spam during park entrance drawing --- src/openrct2/object/ObjectManager.cpp | 2 +- src/openrct2/paint/tile_element/Entrance.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index bed3128eaf..f7c77bd3da 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -76,7 +76,7 @@ public: if (index >= (size_t)object_entry_group_counts[objectType]) { #ifdef DEBUG - log_warning("Object index %u exceeds maximum for type type %d.", index, objectType); + log_warning("Object index %u exceeds maximum for type %d.", index, objectType); #endif return nullptr; } diff --git a/src/openrct2/paint/tile_element/Entrance.cpp b/src/openrct2/paint/tile_element/Entrance.cpp index 0468e9f4de..2dfdfde0ef 100644 --- a/src/openrct2/paint/tile_element/Entrance.cpp +++ b/src/openrct2/paint/tile_element/Entrance.cpp @@ -211,11 +211,17 @@ static void park_entrance_paint(paint_session * session, uint8 direction, sint32 _unk9E32BC = ghost_id; } - rct_footpath_entry* path_entry = get_footpath_entry(tile_element->properties.entrance.path_type); - // Index to which part of the entrance // Middle, left, right uint8 part_index = tile_element->properties.entrance.index & 0xF; + rct_footpath_entry * path_entry = nullptr; + + // The left and right of the park entrance often have this set to 127. + // So only attempt to get the footpath type if we're dealing with the middle bit of the entrance. + if (part_index == 0) + path_entry = get_footpath_entry(tile_element->properties.entrance.path_type); + + rct_entrance_type* entrance; uint8 di = ((direction / 2 + part_index / 2) & 1) ? 0x1A : 0x20;