You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In r2499 (SL v15) map array has been extended in a way that signal type got 1 extra bit for the early PBS'es. To be able to do this signal variant bit had to be moved. In r3472 (SL 21) the early PBS'es were removed and map array changes were reverted.
There is a piece of code in the afterload.cpp (around line 1217) which tries to fix bits when loading a savegame from that period of time:
/* the signal variant back */
SetSignalVariant(t, TRACK_X, HasBit(_m[t].m2, 3) ? SIG_SEMAPHORE : SIG_ELECTRIC);
ClrBit(_m[t].m2, 3);
You can see SetSignalType and SetSignalVariant. BUT these two functions changed since then, twice! We have new versions operating on different bits! Currently signal type occupies 3 bits, not 2. Also signal variant bits changed again to bit 3. One of undesired effects of this faulty conversion is wrong signal variant - all signals get converted to electric variant.
I'm attaching three files:
- patch to fix the issue
- a test savegame file saved with r3420 (somewhere between saveload v15 and v20)
- screenshots showing what happens when loading attached .sav file (LEFT: trunk r3420, CENTER: current trunk, RIGHT: patched trunk)
adf88 opened the ticket and wrote:
Attachments
Reported version: trunk
Operating system: All
This issue was imported from FlySpray: https://bugs.openttd.org/task/5731
The text was updated successfully, but these errors were encountered: