OpenRCT2
OpenRCT2 copied to clipboard
Guests do not stop at level railway crossings if approaching from downhill.
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)
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
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.
I'll try to figure out the cause and make a fix after my PR #18057 has been completed.