Did anyone else notice that the current_order in a vehicle struct is not saved/loaded correctly? The next-pointer in thr order is NULL upon load.
The orders in the order list are all linked as they should (with only the last order pointing to NULL). But that is because they are all in the order pool.
I've traced some desync errors to this with my custom code, but since current_order has 100+ usages and GetNext() 100+ as well, I can imagine this causing trouble in other parts of the code also.
Does anyone know why the vehicle stores the order in full, instead of a pointer or index of the actual order in the order list?
vehicle.current_order does not load correctly
Moderator: OpenTTD Developers
Re: vehicle.current_order does not load correctly
"current_order" is independent of the vehicle orders. I would expect it's "next" pointer to always be NULL.
"current_order" also contains orders like "loading/unloading" and "going to depot by manual order", which are not part of the regular orders.
"current_order" also contains orders like "loading/unloading" and "going to depot by manual order", which are not part of the regular orders.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Who is online
Users browsing this forum: Amazon [Bot] and 45 guests