(svn r27030) -Fix: crash when having the vehicle list opened from a buoy or oil rig while the buoy/oil rig gets its final removal (i.e. the sign gets removed)

This commit is contained in:
rubidium
2014-10-21 19:16:47 +00:00
parent 96c321e958
commit e811fa1718
4 changed files with 16 additions and 25 deletions

View File

@@ -67,7 +67,7 @@ public:
}
this->FinishInitNested(window_number);
if (this->wp->owner != OWNER_NONE) this->owner = this->wp->owner;
this->owner = this->wp->owner;
this->flags |= WF_DISABLE_VP_SCROLL;
NWidgetViewport *nvp = this->GetWidget<NWidgetViewport>(WID_W_VIEWPORT);
@@ -78,13 +78,7 @@ public:
~WaypointWindow()
{
Owner owner = this->owner;
/* Buoys have no owner and can be used by everyone. Show only 'our' vehicles */
if (!Company::IsValidID(owner)) owner = _local_company;
/* Well, spectators otoh */
if (Company::IsValidID(owner)) DeleteWindowById(GetWindowClassForVehicleType(this->vt), VehicleListIdentifier(VL_STATION_LIST, this->vt, owner, this->window_number).Pack(), false);
DeleteWindowById(GetWindowClassForVehicleType(this->vt), VehicleListIdentifier(VL_STATION_LIST, this->vt, this->owner, this->window_number).Pack(), false);
}
virtual void SetStringParameters(int widget) const