1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 21:43:06 +01:00

Remove no longer required bounds check

This commit is contained in:
Gymnasiast
2024-05-27 20:43:57 +02:00
parent 8c1a841a7f
commit eb1bb3b985

View File

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