mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r13146) -Codechange: vehicle_base.h doesn't need to be included in vehicle_gui.h.
This commit is contained in:
parent
dbdfccc2da
commit
9717e1ef07
|
@ -216,7 +216,7 @@ static CommandCost ReplaceVehicle(Vehicle **w, byte flags, Money total_cost, con
|
|||
// copy/clone the orders
|
||||
DoCommand(0, (old_v->index << 16) | new_v->index, old_v->IsOrderListShared() ? CO_SHARE : CO_COPY, DC_EXEC, CMD_CLONE_ORDER);
|
||||
new_v->cur_order_index = old_v->cur_order_index;
|
||||
ChangeVehicleViewWindow(old_v, new_v);
|
||||
ChangeVehicleViewWindow(old_v->index, new_v->index);
|
||||
new_v->profit_this_year = old_v->profit_this_year;
|
||||
new_v->profit_last_year = old_v->profit_last_year;
|
||||
new_v->service_interval = old_v->service_interval;
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include "core/alloc_type.hpp"
|
||||
#include "animated_tile_func.h"
|
||||
#include "tilehighlight_func.h"
|
||||
#include "core/bitmath_func.hpp"
|
||||
|
||||
#include "table/strings.h"
|
||||
#include "table/sprites.h"
|
||||
|
|
|
@ -2805,11 +2805,11 @@ Vehicle *BackuppedVehicle::Restore(Vehicle *v, Player *p)
|
|||
{
|
||||
if (!ContainsBackup()) return v;
|
||||
if (v != NULL) {
|
||||
ChangeVehicleViewWindow(v, INVALID_VEHICLE);
|
||||
ChangeVehicleViewWindow(v->index, INVALID_VEHICLE);
|
||||
DoCommand(0, v->index, 1, DC_EXEC, GetCmdSellVeh(v));
|
||||
}
|
||||
v = RestoreBackupVehicle(this->vehicles, p);
|
||||
ChangeVehicleViewWindow(INVALID_VEHICLE, v);
|
||||
ChangeVehicleViewWindow(INVALID_VEHICLE, v->index);
|
||||
if (orders != NULL) RestoreVehicleOrdersBruteForce(v, orders);
|
||||
if (economy != NULL) economy->Restore();
|
||||
/* If we stored cargo as well then we should restore it. */
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include "order_type.h"
|
||||
#include "station_type.h"
|
||||
#include "engine_type.h"
|
||||
#include "vehicle_base.h"
|
||||
|
||||
void DrawVehicleProfitButton(const Vehicle *v, int x, int y);
|
||||
void ShowVehicleRefitWindow(const Vehicle *v, VehicleOrderID order);
|
||||
|
@ -90,21 +89,6 @@ void DrawVehicleImage(const Vehicle *v, int x, int y, VehicleID selection, int c
|
|||
* For ease of use it can be called with both Vehicle pointers and VehicleIDs. */
|
||||
void ChangeVehicleViewWindow(VehicleID from_index, VehicleID to_index);
|
||||
|
||||
static inline void ChangeVehicleViewWindow(const Vehicle *from_v, VehicleID to_index)
|
||||
{
|
||||
ChangeVehicleViewWindow(from_v->index, to_index);
|
||||
}
|
||||
|
||||
static inline void ChangeVehicleViewWindow(VehicleID from_index, const Vehicle *to_v)
|
||||
{
|
||||
ChangeVehicleViewWindow(from_index, to_v->index);
|
||||
}
|
||||
|
||||
static inline void ChangeVehicleViewWindow(const Vehicle *from_v, const Vehicle *to_v)
|
||||
{
|
||||
ChangeVehicleViewWindow(from_v->index, to_v->index);
|
||||
}
|
||||
|
||||
static inline uint GetVehicleListHeight(VehicleType type)
|
||||
{
|
||||
return (type == VEH_TRAIN || type == VEH_ROAD) ? 14 : 24;
|
||||
|
|
Loading…
Reference in New Issue