Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making elrails optional #297

Closed
DorpsGek opened this issue Aug 21, 2006 · 6 comments
Closed

Making elrails optional #297

DorpsGek opened this issue Aug 21, 2006 · 6 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

Maedhros opened the ticket and wrote:

This is a patch to make elrails optional, which can be used before and after a game has started. It works by changing the railtype - when disabling elrails RAILTYPE_ELECTRIC is converted to RAILTYPE_RAIL indiscriminately. When enabling it, vehicles with engclass == 2 and e->railtype == RAILTYPE_RAIL have their railtype changed to RAILTYPE_ELECTRIC.

This doesn't affect any vehicles which have already been built - they will happily keep on running until you send them to a depot and change them in some way, at which point electric trains will refuse to start if they're in an unelectrified depot.

This patch was made against svn trunk r6028.

Attachments

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/297
@DorpsGek
Copy link
Member Author

KUDr wrote:

More complete patch ('optional_elrail'):
- old savegames have elrails always enabled when they are loaded
- if railway build toolbar for elrails is visible when elrails are disabled it is changed to normal rail type (also across network)
- catenary drawing is immediatelly disabled (also on the MP clients) when elrails are disabled
- contains also 'patches_cb' patch that fixes two issues:
- the _patches settings callbacks were not called on the clients (when setting is not marked as local-player-only)
- on the MP server this callback was called before the change happened and received the old value instead of new one as 'p1' parameter

Please look at it, test it and report bugs/issues/objections asap. Darkvater wants it ready before 0.5 release
thanks

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/297#comment623

@DorpsGek
Copy link
Member Author

KUDr wrote:

Updated version:
- added elrail enable/disable callback when new game starts

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/297#comment624

@DorpsGek
Copy link
Member Author

KUDr wrote:

Update:
- some desync issue with older savegames solved
- pre-elrail games (pre-r4150) are loaded with elrails disabled
- elrail games (r4150+) are loaded with elrails enabled

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/297#comment625

@DorpsGek
Copy link
Member Author

KUDr wrote:

Update:
- solved issue when after [disable - enable - save - load] electric engines in loaded savegame were unable to run on normal rail.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/297#comment641

@DorpsGek
Copy link
Member Author

KUDr wrote:

Update:
- when disabled elrails and trying to convert (invisible) elrail into normal rail then the existing elrail is treated as normal rail (can't be converted to the same type), so such converion fails.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/297#comment642

@DorpsGek
Copy link
Member Author

KUDr closed the ticket.

Reason for closing: Implemented

r7195


This comment was imported from FlySpray: https://bugs.openttd.org/task/297

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant