mirror of https://github.com/OpenRCT2/OpenRCT2.git
* Fix #20361: Crash using map generation * Update changelog.txt
This commit is contained in:
parent
1b612b5a99
commit
d9a565dd21
|
@ -12,6 +12,7 @@
|
|||
- Fix: [#20155] Fairground organ style 2 shows up as regular music, rather than for the merry-go-round.
|
||||
- Fix: [#20260] Ride locks up when inspecting/fixing staff member is fired.
|
||||
- Fix: [#20262] Title screen music missing when “random” title music is selected and RCT1 is no longer linked.
|
||||
- Fix: [#20361] Crash when using random map generation.
|
||||
|
||||
0.4.5 (2023-05-08)
|
||||
------------------------------------------------------------------------
|
||||
|
|
|
@ -370,7 +370,7 @@ static void MapGenPlaceTrees()
|
|||
neighbourPos.y = std::clamp(neighbourPos.y, COORDS_XY_STEP, COORDS_XY_STEP * (gMapSize.y - 1));
|
||||
|
||||
const auto neighboutSurface = MapGetSurfaceElementAt(neighbourPos);
|
||||
if (neighboutSurface->GetWaterHeight() > 0)
|
||||
if (neighboutSurface != nullptr && neighboutSurface->GetWaterHeight() > 0)
|
||||
{
|
||||
float distance = std::sqrt(offsetX * offsetX + offsetY * offsetY);
|
||||
oasisScore += 0.5f / (maxOasisDistance * distance);
|
||||
|
|
Loading…
Reference in New Issue