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

Assertion with Vehicle list #542

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

Assertion with Vehicle list #542

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

Comments

@DorpsGek
Copy link
Member

Eddi opened the ticket and wrote:

src/vehicle_gui.cpp:1607: void DrawVehicleListWindow(Window*): Assertion `0' failed. (revision 8083)

to reproduce:

have two vehicles with shared orders
open the list of all vehicles with this shared order
edit the orders of one of the vehicles
remove all orders from this vehicle (except the "end of shared orders" item)

Reported version: trunk
Operating system: All


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

Darkvater wrote:

The current code is broken by design. It assumes orders are shared if v->orders->index match, while this is NOT the case.
Orders are shared IF v->next_shared OR v->prev_shared is not NULL.
Also if the 'shared orders' line is deleted, the window stays open with one vehicle. One could debate whether this is wrong or not.

Unfortunately with the current cludge of assigning the order/station/etc to window_number you cannot store the Order* pointer in there which would be the correct choice.

Perhaps best choice for now would be to delete the window if list is empty?


This comment was imported from FlySpray: https://bugs.openttd.org/task/542#comment829

@DorpsGek
Copy link
Member Author

TrueBrain wrote:

The assert() in fact is simple to resolve, by making the system consistent: close the window when there are no orders. As you can't open the list either when there are no orders, this adds consistent. Of course it is far from what we really want, but it works for now.


This comment was imported from FlySpray: https://bugs.openttd.org/task/542#comment1089

@DorpsGek
Copy link
Member Author

TrueBrain closed the ticket.

Reason for closing: Fixed

Fixed in r9337


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

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Vehicles 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