(svn r14748) -Codechange: unduplicate window updating when deleting vehicles.

This commit is contained in:
rubidium
2008-12-26 21:08:51 +00:00
parent f18043ee21
commit 3ebe66a5e4
6 changed files with 11 additions and 39 deletions

View File

@@ -53,6 +53,7 @@
#include "core/alloc_func.hpp"
#include "core/smallmap_type.hpp"
#include "vehiclelist.h"
#include "depot_func.h"
#include "table/sprites.h"
#include "table/strings.h"
@@ -668,8 +669,17 @@ void Vehicle::PreDestructor()
InvalidateWindowData(WC_VEHICLE_DEPOT, this->tile);
}
if (this->IsPrimaryVehicle()) {
DeleteWindowById(WC_VEHICLE_VIEW, this->index);
DeleteWindowById(WC_VEHICLE_DETAILS, this->index);
DeleteWindowById(WC_VEHICLE_ORDERS, this->index);
InvalidateWindow(WC_COMPANY, this->owner);
}
InvalidateWindowClassesData(GetWindowClassForVehicleType(this->type), 0);
this->cargo.Truncate(0);
DeleteVehicleOrders(this);
DeleteDepotHighlightOfVehicle(this);
extern void StopGlobalFollowVehicle(const Vehicle *v);
StopGlobalFollowVehicle(this);