JGRennison / OpenTTD-patches

OpenTTD - http://www.openttd.org/ - with additional patches
Other
581 stars 133 forks source link

[Bug]: Road Waypoints classes that start with 0xFF are unbuildable #775

Open ahyangyi opened 4 hours ago

ahyangyi commented 4 hours ago

Version of OpenTTD

jgrpp-0.63.1-16 (jgrpp branch head)

Expected result

A road stop that uses a station class that starts with 0xFF is recognized as a waypoint, and can be built normally.

Actual result

A road stop that uses a station class that starts with 0xFF is indeed recognized as a waypoint, but raises an error when one tries to build it.

Steps to reproduce

Use the in-game download service to get China Set: Stations - Wuhu version 0.3.1 (the latest one), and attempt to build a road waypoint.

ahyangyi commented 4 hours ago

I also looked at the source code, and noticed that the if-condition below seems to be slightly outdated (i.e. before the addition of 0xFF classes)

https://github.com/JGRennison/OpenTTD-patches/blob/9ef14f921db01e4d6b6d4819d8e7a8be658f4752/src/waypoint_cmd.cpp#L366

The equivalent vanilla OpenTTD code doesn't seem to contain the same behavior, so I believe this is a JGRPP bug.

ahyangyi commented 4 hours ago

Here is the corresponding vanilla OpenTTD code, IsWaypointClass allows those 0xFF station classes.

https://github.com/OpenTTD/OpenTTD/blob/master/src/waypoint_cmd.cpp#L341

JGRennison commented 2 hours ago

Thanks, this should be fixed in the next release