Page 1 of 1

vehicle.current_order does not load correctly

Posted: 30 Apr 2018 08:34
by Rull
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?

Re: vehicle.current_order does not load correctly

Posted: 09 May 2018 19:38
by frosch
"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.