OpenTTD Source 20260208-master-g43af8e94d0
autoreplace_cmd.h File Reference

Command definitions related to autoreplace. More...

#include "command_type.h"
#include "vehicle_type.h"
#include "engine_type.h"
#include "group_type.h"

Go to the source code of this file.

Functions

CommandCost CmdAutoreplaceVehicle (DoCommandFlags flags, VehicleID veh_id)
 Autoreplaces a vehicle Trains are replaced as a whole chain, free wagons in depot are replaced on their own.
CommandCost CmdSetAutoReplace (DoCommandFlags flags, GroupID id_g, EngineID old_engine_type, EngineID new_engine_type, bool when_old)
 Change engine renewal parameters.

Detailed Description

Command definitions related to autoreplace.

Definition in file autoreplace_cmd.h.

Function Documentation

◆ CmdAutoreplaceVehicle()

◆ CmdSetAutoReplace()

CommandCost CmdSetAutoReplace ( DoCommandFlags flags,
GroupID id_g,
EngineID old_engine_type,
EngineID new_engine_type,
bool when_old )

Change engine renewal parameters.

Parameters
flagsoperation to perform
id_gengine group
old_engine_typeold engine type
new_engine_typenew engine type
when_oldreplace when engine gets old?
Returns
the cost of this operation or an error

Definition at line 827 of file autoreplace_cmd.cpp.

References _current_company, AddEngineReplacementForCompany(), CheckAutoreplaceValidity(), CMD_ERROR, Execute, GetWindowClassForVehicleType(), InvalidateAutoreplaceWindow(), IsAllGroupID(), IsLocalCompany(), RemoveEngineReplacementForCompany(), SetWindowDirty(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), GroupStatistics::UpdateAutoreplace(), VL_GROUP_LIST, and WC_REPLACE_VEHICLE.