diff --git a/changelog.txt b/changelog.txt index 63bacef506..fc85e5d270 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,12 @@ +1.0.2 (2010-06-19) +------------------------------------------------------------------------ +- Fix: Owner of the Waypoint View window was not properly set (r19990) +- Fix: Close list of vehicles with given oil rig in orders when the oil rig is deleted (r19956) +- Fix: Close list of vehicles with given buoy/oil rig in orders when switching company (r19955) +- Fix: Do not close list of waypoint's trains when the waypoint view is closed when it is sticky (r19952) +- Fix: Close buoy's vehicle list when the buoy is deleted [FS#3869] (r19951) + + 1.0.2-RC1 (2010-06-05) ------------------------------------------------------------------------ - Feature: Translated desktop shortcut comments (r19884) diff --git a/known-bugs.txt b/known-bugs.txt index 81d51e4572..b8831e28c4 100644 --- a/known-bugs.txt +++ b/known-bugs.txt @@ -1,6 +1,6 @@ OpenTTD's known bugs -Last updated: 2010-05-01 -Release version: 1.0.1 +Last updated: 2010-06-19 +Release version: 1.0.2 ------------------------------------------------------------------------ diff --git a/os/debian/changelog b/os/debian/changelog index 0a2dde24e9..212c8d108b 100644 --- a/os/debian/changelog +++ b/os/debian/changelog @@ -1,3 +1,9 @@ +openttd (1.0.2-0) unstable; urgency=low + + * New upstream release 1.0.2 + + -- Matthijs Kooijman Sat, 19 Jun 2010 18:36:21 +0000 + openttd (1.0.2~rc1-0) unstable; urgency=low * New upstream release 1.0.2-RC1 diff --git a/readme.txt b/readme.txt index 77aad0ddab..e0fe5b1730 100644 --- a/readme.txt +++ b/readme.txt @@ -1,6 +1,6 @@ OpenTTD README -Last updated: 2010-05-01 -Release version: 1.0.1 +Last updated: 2010-06-19 +Release version: 1.0.2 ------------------------------------------------------------------------ diff --git a/src/station.cpp b/src/station.cpp index fef63b3050..b5bbaacdec 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -11,6 +11,7 @@ #include "stdafx.h" #include "company_func.h" +#include "company_base.h" #include "roadveh.h" #include "functions.h" #include "window_func.h" @@ -82,7 +83,10 @@ Station::~Station() InvalidateWindowData(WC_STATION_LIST, this->owner, 0); DeleteWindowById(WC_STATION_VIEW, index); - WindowNumber wno = (this->index << 16) | VLW_STATION_LIST | this->owner; + + Owner owner = this->owner; + if (!Company::IsValidID(owner)) owner = _local_company; + WindowNumber wno = (this->index << 16) | VLW_STATION_LIST | owner; DeleteWindowById(WC_TRAINS_LIST, wno | (VEH_TRAIN << 11)); DeleteWindowById(WC_ROADVEH_LIST, wno | (VEH_ROAD << 11)); DeleteWindowById(WC_SHIPS_LIST, wno | (VEH_SHIP << 11)); diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 6efb569f2c..dfbdc4a54c 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -1190,33 +1190,12 @@ struct StationViewWindow : public Window { this, CS_ALPHANUMERAL, QSF_ENABLE_DEFAULT); break; - case SVW_TRAINS: { // Show a list of scheduled trains to this station - const Station *st = Station::Get(this->window_number); - ShowVehicleListWindow(st->owner, VEH_TRAIN, (StationID)this->window_number); + case SVW_TRAINS: // Show list of scheduled trains to this station + case SVW_ROADVEHS: // Show list of scheduled road-vehicles to this station + case SVW_PLANES: // Show list of scheduled aircraft to this station + case SVW_SHIPS: // Show list of scheduled ships to this station + ShowVehicleListWindow(this->owner, (VehicleType)(widget - SVW_TRAINS), (StationID)this->window_number); break; - } - - case SVW_ROADVEHS: { // Show a list of scheduled road-vehicles to this station - const Station *st = Station::Get(this->window_number); - ShowVehicleListWindow(st->owner, VEH_ROAD, (StationID)this->window_number); - break; - } - - case SVW_PLANES: { // Show a list of scheduled aircraft to this station - const Station *st = Station::Get(this->window_number); - /* Since oilrigs have no owners, show the scheduled aircraft of local company */ - Owner owner = (st->owner == OWNER_NONE) ? _local_company : st->owner; - ShowVehicleListWindow(owner, VEH_AIRCRAFT, (StationID)this->window_number); - break; - } - - case SVW_SHIPS: { // Show a list of scheduled ships to this station - const Station *st = Station::Get(this->window_number); - /* Since oilrigs/bouys have no owners, show the scheduled ships of local company */ - Owner owner = (st->owner == OWNER_NONE) ? _local_company : st->owner; - ShowVehicleListWindow(owner, VEH_SHIP, (StationID)this->window_number); - break; - } } } diff --git a/src/station_gui.h b/src/station_gui.h index cb8b278cfc..dd442dce4a 100644 --- a/src/station_gui.h +++ b/src/station_gui.h @@ -29,8 +29,8 @@ enum StationViewWidgets { SVW_RENAME = 6, ///< 'Rename' button SVW_TRAINS = 7, ///< List of scheduled trains button SVW_ROADVEHS, ///< List of scheduled road vehs button - SVW_PLANES, ///< List of scheduled planes button SVW_SHIPS, ///< List of scheduled ships button + SVW_PLANES, ///< List of scheduled planes button }; /** Types of cargo to display for station coverage. */ diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 55af88d2bd..6d871f0b17 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1245,7 +1245,12 @@ static WindowDesc _vehicle_list_desc( static void ShowVehicleListWindowLocal(CompanyID company, uint16 VLW_flag, VehicleType vehicle_type, uint16 unique_number) { - if (!Company::IsValidID(company)) return; + if (!Company::IsValidID(company)) { + _vehicle_list_desc.flags |= WDF_CONSTRUCTION; + company = _local_company; + } else { + _vehicle_list_desc.flags &= ~WDF_CONSTRUCTION; + } _vehicle_list_desc.cls = GetWindowClassForVehicleType(vehicle_type); WindowNumber num = (unique_number << 16) | (vehicle_type << 11) | VLW_flag | company; diff --git a/src/waypoint.cpp b/src/waypoint.cpp index bc7bf2975f..6ed11799b4 100644 --- a/src/waypoint.cpp +++ b/src/waypoint.cpp @@ -15,6 +15,9 @@ #include "window_func.h" #include "newgrf_station.h" #include "waypoint_base.h" +#include "vehicle_gui.h" +#include "company_func.h" +#include "company_base.h" /** * Draw a waypoint @@ -53,5 +56,11 @@ Waypoint::~Waypoint() DeleteWindowById(WC_WAYPOINT_VIEW, this->index); RemoveOrderFromAllVehicles(OT_GOTO_WAYPOINT, this->index); + Owner owner = this->owner; + if (!Company::IsValidID(owner)) owner = _local_company; + WindowNumber wno = (this->index << 16) | VLW_WAYPOINT_LIST | owner; + DeleteWindowById(WC_TRAINS_LIST, wno | (VEH_TRAIN << 11)); + DeleteWindowById(WC_SHIPS_LIST, wno | (VEH_SHIP << 11)); + this->sign.MarkDirty(); } diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp index 0a6d10a10e..a6a6d98ac5 100644 --- a/src/waypoint_gui.cpp +++ b/src/waypoint_gui.cpp @@ -18,6 +18,7 @@ #include "strings_func.h" #include "command_func.h" #include "company_func.h" +#include "company_base.h" #include "window_func.h" #include "waypoint_base.h" @@ -43,8 +44,6 @@ public: this->wp = Waypoint::Get(window_number); this->vt = (wp->string_id == STR_SV_STNAME_WAYPOINT) ? VEH_TRAIN : VEH_SHIP; - if (this->wp->owner != OWNER_NONE) this->owner = this->wp->owner; - this->CreateNestedTree(desc); if (this->vt == VEH_TRAIN) { this->GetWidget(WAYPVW_SHOW_VEHICLES)->SetDataTip(STR_TRAIN, STR_STATION_VIEW_SCHEDULED_TRAINS_TOOLTIP); @@ -53,7 +52,9 @@ public: } this->FinishInitNested(desc, window_number); + if (this->wp->owner != OWNER_NONE) this->owner = this->wp->owner; this->flags4 |= WF_DISABLE_VP_SCROLL; + NWidgetViewport *nvp = this->GetWidget(WAYPVW_VIEWPORT); nvp->InitializeViewport(this, this->wp->xy, ZOOM_LVL_MIN); @@ -62,7 +63,9 @@ public: ~WaypointWindow() { - DeleteWindowById(GetWindowClassForVehicleType(this->vt), (this->window_number << 16) | (this->vt << 11) | VLW_WAYPOINT_LIST | this->wp->owner); + Owner owner = this->owner; + if (!Company::IsValidID(owner)) owner = _local_company; + DeleteWindowById(GetWindowClassForVehicleType(this->vt), (this->window_number << 16) | (this->vt << 11) | VLW_WAYPOINT_LIST | owner, false); } virtual void SetStringParameters(int widget) const @@ -92,7 +95,7 @@ public: break; case WAYPVW_SHOW_VEHICLES: // show list of vehicles having this waypoint in their orders - ShowVehicleListWindow((this->wp->owner == OWNER_NONE) ? _local_company : this->wp->owner, this->vt, this->wp); + ShowVehicleListWindow(this->owner, this->vt, this->wp); break; } }