1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Avoid warning spam during park entrance drawing

This commit is contained in:
Gymnasiast
2018-03-13 20:48:16 +01:00
parent b78bd587b7
commit 8e37ee26c9
2 changed files with 9 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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;