OpenRCT2 icon indicating copy to clipboard operation
OpenRCT2 copied to clipboard

Guests do not stop at level railway crossings if approaching from downhill.

Open ocalhoun6 opened this issue 2 years ago • 2 comments

Operating System

Ubuntu 20.04 LTS

OpenRCT2 build

Unknown

Describe the issue

OS: Ubuntu Linux 20.04 Version: 0.4.1 Commit/Build: Unknown -- #12909

While trying to figure out more about #10535, I came across another bug with level crossings. If the path the guests are approaching from is downhill from the crossing, they will not stop. Crossings on level ground and crossings with the guest coming from uphill do not seem to be affected.

If you open this saved demonstration in Forest Frontiers, you can very easily see this happening: crosing_error_demo.zip (Rename to .park)

Forest Frontiers 2022-08-23 16-14-04

Forest Frontiers 2022-08-23 16-16-24

Area(s) with issue?

No response

Steps to reproduce

1: Open the attached save

2: Just observe

Alternately:

1: Build a miniature railroad at the top of a hill, directly next to the slope

2: Cross the railroad track with a path, creating a level crossing at the top of the slope

3: Open the ride and get guests walking on the path

4: Observe that guests heading downhill do stop for trains, but guests heading uphill do not.

Attachments

No response

ocalhoun6 avatar Aug 23 '22 23:08 ocalhoun6

I think this is caused by an oversight in this code:

auto curPos = TileCoordsXYZ(GetLocation());

auto dstPos = TileCoordsXYZ(CoordsXYZ{ GetDestination(), NextLoc.z });

if ((curPos.x != dstPos.x || curPos.y != dstPos.y) && footpath_is_blocked_by_vehicle(dstPos))

Which will reside in lines 326-328 of Peep.cpp after #18057 goes through.

Maybe because there's no dstPos.z? Something like that. I wish I was good enough with this code to figure out exactly what's going wrong.

ocalhoun6 avatar Sep 19 '22 22:09 ocalhoun6

I'll try to figure out the cause and make a fix after my PR #18057 has been completed.

rik-smeets avatar Sep 20 '22 16:09 rik-smeets