JGRennison / OpenTTD-patches

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

[Bug]: Autorenew numbers player's last train incorrectly #725

Closed mallardtheduck closed 3 months ago

mallardtheduck commented 4 months ago

Version of OpenTTD

jgrpp-0.59.1, macos

Expected result

When autorenew (with "keep remainders" turned on) causes the player to reach their number of trains limit, the "created" trian should be numbered correctly (e.g. number 500 if the limit is 500). If possible, subsequent autorenews should display an error message to inform the player that they have reached the limit.

Actual result

When autorenew (with "keep remainders" turned on) causes the player to reach their number of trains limit, the "created" trian is numbered 65535. No error message is displayed to inform the user that they have reached the limit.

Steps to reproduce

  1. Build limit-1 trains.
  2. Set up an replacement tempalate that will change the locomotive, and has "keep remainders" turned on.
  3. Apply this template to one or more of the trains in the game.
  4. Note the creation of "train 65535" and no error message.
JGRennison commented 3 months ago

This should be fixed now, the issue isn't to do with autorenew or template replacement (which is what I think you are talking about) per se, it's just to do with moving an engine out of a train to form a new train which meets the train limit.

Forwarded upstream here: https://github.com/OpenTTD/OpenTTD/pull/12887