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

Bridge building results in 'missing' pieces #519

Closed
DorpsGek opened this issue Jan 6, 2007 · 3 comments
Closed

Bridge building results in 'missing' pieces #519

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

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Jan 6, 2007

Darkvater opened the ticket and wrote:

We have another problem with the town ratings. Its change is not atomic.
Basically a dry run of building a bridge succeeds because town penalty ratings are not accumulated.

When a bridge is actually built (see attached savegame) the penalty for removing the tree is deducted but the town will not allow removing its road, thus the command fails for the execution run (res != res2). Without assertions you will get the following picture, and broken savegame.

A solution would be to somehow get the town penalties from the deep underlying function and check that in the dry run as well...any clever ideas?

Thankfully to reproduce this bug you need very specific circumstances that won't happen too often, but this should be fixed. The only problem is how to return back the town penalties from a tile-independent CMD_LANDSCAPE_CLEAR and deal with the possible multiple town authorities the tiles along the way might belong to.

Attachments

Reported version: trunk
Operating system: All


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

DorpsGek commented Jan 6, 2007

Darkvater wrote:

I would have an idea for solvage that could include something similar to the SET_EXPENSES_MACRO but with a function for town ratings. The only problem is it wouldn't check ratings for the multiple towns the bridge might pass through...

It would be something like:
StartTownRatingModificationCount();
..
do commands
..
modification = GetTownRatingModificationCount();

if (t->ratings[player] - modification < 0) cmd_error;


This comment was imported from FlySpray: https://bugs.openttd.org/task/519#comment803

@DorpsGek
Copy link
Member Author

DorpsGek commented Jan 8, 2007

Darkvater wrote:

Bug does not happen in trunk/ after bridge-merge because even half-road pieces are not removed. Only other thing that could be removed are trees, but those are not checked for permission by town-authority.

So this bug might be obsolete. Still it would be nice to have some access to the town-rating affect numbers as then the CMD_AUTO hacks can be removed.


This comment was imported from FlySpray: https://bugs.openttd.org/task/519#comment805

@DorpsGek
Copy link
Member Author

Rubidium closed the ticket.

Reason for closing: Fixed

Already fixed in trunk.


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

@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