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

[PATCH] convert railtype Rail <-> ElRail #1182

Closed
DorpsGek opened this issue Sep 1, 2007 · 4 comments
Closed

[PATCH] convert railtype Rail <-> ElRail #1182

DorpsGek opened this issue Sep 1, 2007 · 4 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Sep 1, 2007

SmatZ opened the ticket and wrote:

r11027

In current version, there are some problems with Rail <-> ElRail conversions.
Only depot tile can be converted, but then there may be a train outside the depot.
Then, there are problems when the rail is converted back to elrail (it has to be reversed so the cached_power is updated).

On non-depot rail, the message TrainInTheWay is shown.

Similiar behaviour can be seen in 0.5 branch, but there cached_power is updated without reversing the train.

This patch allows Rail <-> ElRail conversion for all tiles, even when a train is on. Its power is upgraded using faster method, with VehicleFromPos instead of FOR_ALL_VEHICLES.
Also, some parts were unified into CmdConvertRail().

known "problems"
- when downgraded to rail, el.train will slow down slowly when on a bringe/tunnel, because it stays on the same "tile". On normal track, it stops when it should enter new tile
- train doesn't restart, when it enters electrified tile

This can be changed if this patch gets accepted. I don't want to make big patches as smaller will be accepted more likely.

Attachments

Reported version: trunk
Operating system: All


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

DorpsGek commented Sep 4, 2007

SmatZ wrote:

No comments yet :-(

So I attach actual diff and two savegames.

The 9th Jan - from 0.5.2, the same way behaves actual trunk.
The 10th Jan - modified trunk. Train is stopped when rail is converted.

(note: when loaded "9th Jan" in patched version, it will behave the same as in older versions - the status of the train is incorrect)
(actually, the diff does more work - it allows conversion of all rail tiles, not just depots)

Any comment appreciated

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1182#comment2053

@DorpsGek
Copy link
Member Author

DorpsGek commented Sep 4, 2007

SmatZ wrote:

One more change for 11039... (causing only warnings)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1182#comment2054

@DorpsGek
Copy link
Member Author

DorpsGek commented Sep 8, 2007

SmatZ wrote:

Updated to newer svn, fixed one bug:
if tunnel was busy, endtile was returned and INVALID_TILE, and so, INVALID_TILE was used as endtile when converting compatible rail.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/1182#comment2092

@DorpsGek
Copy link
Member Author

DorpsGek commented Sep 8, 2007

Rubidium closed the ticket.

Reason for closing: Fixed

In r11059.


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

@DorpsGek DorpsGek closed this as completed Sep 8, 2007
@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) 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/)
Projects
None yet
Development

No branches or pull requests

1 participant