Apply review suggestion

This commit is contained in:
ζeh Matt 2023-08-06 13:33:31 +03:00
parent 5f515b6a73
commit 375ce5c123
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0
1 changed files with 3 additions and 2 deletions

View File

@ -126,8 +126,9 @@ PathElement* MapGetFootpathElement(const CoordsXYZ& coords)
{
if (tileElement == nullptr)
break;
if (tileElement->GetType() == TileElementType::Path && tileElement->GetBaseZ() == coords.z)
return tileElement->AsPath();
auto* pathElement = tileElement->AsPath();
if (pathElement != nullptr && pathElement->GetBaseZ() == coords.z)
return pathElement;
} while (!(tileElement++)->IsLastForTile());
return nullptr;