(svn r14925) -Fix [FS#2500]: Abort dragging of vehicles in the group window when they are deleted.

This commit is contained in:
frosch
2009-01-08 21:16:19 +00:00
parent 17a9bab142
commit b522f73ba8
3 changed files with 32 additions and 0 deletions

View File

@@ -32,6 +32,7 @@
#include "newgrf_station.h"
#include "newgrf_text.h"
#include "group.h"
#include "group_gui.h"
#include "order_func.h"
#include "strings_func.h"
#include "zoom_func.h"
@@ -571,6 +572,7 @@ void Vehicle::PreDestructor()
GetCompany(this->owner)->num_engines[this->engine_type]--;
if (this->owner == _local_company) InvalidateAutoreplaceWindow(this->engine_type, this->group_id);
DeleteGroupHighlightOfVehicle(this);
if (IsValidGroupID(this->group_id)) GetGroup(this->group_id)->num_engines[this->engine_type]--;
if (this->IsPrimaryVehicle()) DecreaseGroupNumVehicle(this->group_id);
}