Departure board: Always invalidate boards in DeleteVehicleOrders
This commit is contained in:
@@ -2469,6 +2469,7 @@ bool Vehicle::HasDepotOrder() const
|
|||||||
void DeleteVehicleOrders(Vehicle *v, bool keep_orderlist, bool reset_order_indices)
|
void DeleteVehicleOrders(Vehicle *v, bool keep_orderlist, bool reset_order_indices)
|
||||||
{
|
{
|
||||||
DeleteOrderWarnings(v);
|
DeleteOrderWarnings(v);
|
||||||
|
InvalidateWindowClassesData(WC_DEPARTURES_BOARD, 0);
|
||||||
|
|
||||||
if (v->IsOrderListShared()) {
|
if (v->IsOrderListShared()) {
|
||||||
/* Remove ourself from the shared order list. */
|
/* Remove ourself from the shared order list. */
|
||||||
@@ -2476,7 +2477,6 @@ void DeleteVehicleOrders(Vehicle *v, bool keep_orderlist, bool reset_order_indic
|
|||||||
v->orders.list = nullptr;
|
v->orders.list = nullptr;
|
||||||
} else {
|
} else {
|
||||||
DeleteWindowById(GetWindowClassForVehicleType(v->type), VehicleListIdentifier(VL_SHARED_ORDERS, v->type, v->owner, v->index).Pack());
|
DeleteWindowById(GetWindowClassForVehicleType(v->type), VehicleListIdentifier(VL_SHARED_ORDERS, v->type, v->owner, v->index).Pack());
|
||||||
InvalidateWindowClassesData(WC_DEPARTURES_BOARD, 0);
|
|
||||||
if (v->orders.list != nullptr) {
|
if (v->orders.list != nullptr) {
|
||||||
/* Remove the orders */
|
/* Remove the orders */
|
||||||
v->orders.list->FreeChain(keep_orderlist);
|
v->orders.list->FreeChain(keep_orderlist);
|
||||||
|
Reference in New Issue
Block a user