From eb1bb3b98567b9d7c06f8c7b6abe6fc03566288f Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Mon, 27 May 2024 20:43:57 +0200 Subject: [PATCH] Remove no longer required bounds check --- src/openrct2/paint/tile_element/Paint.Surface.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index 8faefe0541..87790cdef0 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -347,15 +347,12 @@ static ImageId GetTunnelImage(const TerrainEdgeObject* edgeObject, TunnelType ty hasDoors = edgeObject->HasDoors && !edgeObject->UsesFallbackImages(); } - if (!hasDoors && EnumValue(type) >= kRegularTunnelTypeCount && EnumValue(type) < std::size(kTunnels)) + if (!hasDoors && EnumValue(type) >= kRegularTunnelTypeCount) type = TunnelType::StandardFlat; - ImageId result; - if (EnumValue(type) < std::size(kTunnels)) - { - result = GetEdgeImageWithOffset(edgeObject, kTunnels[EnumValue(type)].imageOffset) - .WithIndexOffset(edge == EDGE_BOTTOMRIGHT ? 2 : 0); - } + ImageId result = GetEdgeImageWithOffset(edgeObject, kTunnels[EnumValue(type)].imageOffset) + .WithIndexOffset(edge == EDGE_BOTTOMRIGHT ? 2 : 0); + return result; }