mirror of https://github.com/OpenTTD/OpenTTD
(svn r17084) -Codechange: _age_cargo_skip_counter is common to all vehicle types
parent
7fcebf0997
commit
9c25f1bdb7
|
@ -928,7 +928,6 @@ void OnTick_Station();
|
||||||
void OnTick_Industry();
|
void OnTick_Industry();
|
||||||
|
|
||||||
void OnTick_Companies();
|
void OnTick_Companies();
|
||||||
void OnTick_Train();
|
|
||||||
|
|
||||||
void CallLandscapeTick()
|
void CallLandscapeTick()
|
||||||
{
|
{
|
||||||
|
@ -938,5 +937,4 @@ void CallLandscapeTick()
|
||||||
OnTick_Industry();
|
OnTick_Industry();
|
||||||
|
|
||||||
OnTick_Companies();
|
OnTick_Companies();
|
||||||
OnTick_Train();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,6 @@ void InitializeGame(uint size_x, uint size_y, bool reset_date)
|
||||||
InitializeIndustries();
|
InitializeIndustries();
|
||||||
InitializeBuildingCounts();
|
InitializeBuildingCounts();
|
||||||
|
|
||||||
InitializeTrains();
|
|
||||||
InitializeNPF();
|
InitializeNPF();
|
||||||
|
|
||||||
InitializeCompanies();
|
InitializeCompanies();
|
||||||
|
|
|
@ -2292,12 +2292,6 @@ CommandCost CmdSendTrainToDepot(TileIndex tile, DoCommandFlag flags, uint32 p1,
|
||||||
return v->SendToDepot(flags, (DepotCommand)(p2 & DEPOT_COMMAND_MASK));
|
return v->SendToDepot(flags, (DepotCommand)(p2 & DEPOT_COMMAND_MASK));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void OnTick_Train()
|
|
||||||
{
|
|
||||||
_age_cargo_skip_counter = (_age_cargo_skip_counter == 0) ? 184 : (_age_cargo_skip_counter - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const int8 _vehicle_smoke_pos[8] = {
|
static const int8 _vehicle_smoke_pos[8] = {
|
||||||
1, 1, 1, 0, -1, -1, -1, 0
|
1, 1, 1, 0, -1, -1, -1, 0
|
||||||
};
|
};
|
||||||
|
@ -4602,8 +4596,3 @@ Trackdir Train::GetVehicleTrackdir() const
|
||||||
|
|
||||||
return TrackDirectionToTrackdir(FindFirstTrack(this->track), this->direction);
|
return TrackDirectionToTrackdir(FindFirstTrack(this->track), this->direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitializeTrains()
|
|
||||||
{
|
|
||||||
_age_cargo_skip_counter = 1;
|
|
||||||
}
|
|
||||||
|
|
|
@ -12,9 +12,6 @@
|
||||||
/* Amount of game ticks */
|
/* Amount of game ticks */
|
||||||
VARDEF uint16 _tick_counter;
|
VARDEF uint16 _tick_counter;
|
||||||
|
|
||||||
/* Skip aging of cargo? */
|
|
||||||
VARDEF byte _age_cargo_skip_counter;
|
|
||||||
|
|
||||||
/* Also save scrollpos_x, scrollpos_y and zoom */
|
/* Also save scrollpos_x, scrollpos_y and zoom */
|
||||||
VARDEF uint16 _disaster_delay;
|
VARDEF uint16 _disaster_delay;
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ VehicleID _vehicle_id_ctr_day;
|
||||||
const Vehicle *_place_clicked_vehicle;
|
const Vehicle *_place_clicked_vehicle;
|
||||||
VehicleID _new_vehicle_id;
|
VehicleID _new_vehicle_id;
|
||||||
uint16 _returned_refit_capacity;
|
uint16 _returned_refit_capacity;
|
||||||
|
byte _age_cargo_skip_counter; ///< Skip aging of cargo?
|
||||||
|
|
||||||
|
|
||||||
/* Initialize the vehicle-pool */
|
/* Initialize the vehicle-pool */
|
||||||
|
@ -439,6 +440,8 @@ void InitializeVehicles()
|
||||||
_vehicle_pool.CleanPool();
|
_vehicle_pool.CleanPool();
|
||||||
_cargo_payment_pool.CleanPool();
|
_cargo_payment_pool.CleanPool();
|
||||||
|
|
||||||
|
_age_cargo_skip_counter = 1;
|
||||||
|
|
||||||
_vehicles_to_autoreplace.Reset();
|
_vehicles_to_autoreplace.Reset();
|
||||||
ResetVehiclePosHash();
|
ResetVehiclePosHash();
|
||||||
}
|
}
|
||||||
|
@ -560,6 +563,8 @@ void CallVehicleTicks()
|
||||||
{
|
{
|
||||||
_vehicles_to_autoreplace.Clear();
|
_vehicles_to_autoreplace.Clear();
|
||||||
|
|
||||||
|
_age_cargo_skip_counter = (_age_cargo_skip_counter == 0) ? 184 : (_age_cargo_skip_counter - 1);
|
||||||
|
|
||||||
Station *st;
|
Station *st;
|
||||||
FOR_ALL_STATIONS(st) LoadUnloadStation(st);
|
FOR_ALL_STATIONS(st) LoadUnloadStation(st);
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@ bool HasVehicleOnPosXY(int x, int y, void *data, VehicleFromPosProc *proc);
|
||||||
void CallVehicleTicks();
|
void CallVehicleTicks();
|
||||||
uint8 CalcPercentVehicleFilled(const Vehicle *v, StringID *colour);
|
uint8 CalcPercentVehicleFilled(const Vehicle *v, StringID *colour);
|
||||||
|
|
||||||
void InitializeTrains();
|
|
||||||
byte VehicleRandomBits();
|
byte VehicleRandomBits();
|
||||||
void ResetVehiclePosHash();
|
void ResetVehiclePosHash();
|
||||||
void ResetVehicleColourMap();
|
void ResetVehicleColourMap();
|
||||||
|
@ -160,6 +159,7 @@ extern VehicleID _vehicle_id_ctr_day;
|
||||||
extern const Vehicle *_place_clicked_vehicle;
|
extern const Vehicle *_place_clicked_vehicle;
|
||||||
extern VehicleID _new_vehicle_id;
|
extern VehicleID _new_vehicle_id;
|
||||||
extern uint16 _returned_refit_capacity;
|
extern uint16 _returned_refit_capacity;
|
||||||
|
extern byte _age_cargo_skip_counter;
|
||||||
|
|
||||||
bool CanVehicleUseStation(EngineID engine_type, const struct Station *st);
|
bool CanVehicleUseStation(EngineID engine_type, const struct Station *st);
|
||||||
bool CanVehicleUseStation(const Vehicle *v, const struct Station *st);
|
bool CanVehicleUseStation(const Vehicle *v, const struct Station *st);
|
||||||
|
|
Loading…
Reference in New Issue