Returns the cost of this operation or an errorĭefinition at line 718 of file autoreplace_cmd.cpp. ◆ ChangeVehicleNews()Īutoreplaces a vehicle Trains are replaced as a whole chain, free wagons in depot are replaced on their own. Referenced by ReplaceChain(), and ReplaceFreeUnit(). References _current_company, AddVehicleAdviceNewsItem(), Vehicle::cargo_type, CommandCost::Failed(), CargoSpec::Get(), Pool::PoolItem::Get(), GetIncompatibleRefitOrderIdForAutoreplace(), GetNewCargoTypeForReplace(), GetNewEngineType(), Pool::PoolItem::index, INVALID_ENGINE, IsLocalCompany(), IsValidCargoID(), CargoSpec::name, and SetDParam(). Returns the newly build and refitted vehicleĭefinition at line 311 of file autoreplace_cmd.cpp. More.īuilds and refits a replacement vehicle Important: The old vehicle is still in the original vehicle chain (used for determining the cargo when the old vehicle did not carry anything, but the new one does) Parameters old_vehĪ single (articulated/multiheaded) vehicle that shall be replaced. More.ĬmdSetAutoReplace ( DoCommandFlag flags, GroupID id_g, EngineID old_engine_type, EngineID new_engine_type, bool when_old)Ĭhange engine renewal parameters. ReplaceChain ( Vehicle **chain, DoCommandFlag flags, bool wagon_removal, bool *nothing_to_do)ĬmdAutoreplaceVehicle ( DoCommandFlag flags, VehicleID veh_id)Īutoreplaces a vehicle Trains are replaced as a whole chain, free wagons in depot are replaced on their own. Replace a single unit in a free wagon chain. ReplaceFreeUnit ( Vehicle **single_unit, DoCommandFlag flags, bool *nothing_to_do) More.ĬopyHeadSpecificThings ( Vehicle *old_head, Vehicle *new_head, DoCommandFlag flags)Ĭopy head specific things to the new vehicle chain after it was successfully constructed. More.īuildReplacementVehicle ( Vehicle *old_veh, Vehicle **new_vehicle, bool part_of_chain)īuilds and refits a replacement vehicle Important: The old vehicle is still in the original vehicle chain (used for determining the cargo when the old vehicle did not carry anything, but the new one does) More.ĭoCmdStartStopVehicle (const Vehicle *v, bool evaluate_callback)ĬmdMoveVehicle (const Vehicle *v, const Vehicle *after, DoCommandFlag flags, bool whole_chain) Get the EngineID of the replacement for a vehicle. GetNewEngineType (const Vehicle *v, const Company *c, bool always_replace, EngineID &e) GetNewCargoTypeForReplace ( Vehicle *v, EngineID engine_type, bool part_of_chain)įunction to find what type of cargo to refit to when autoreplacing. Gets the index of the first refit order that is incompatible with the requested engine type. GetIncompatibleRefitOrderIdForAutoreplace (const Vehicle *v, EngineID engine_type) Tests whether refit orders that applied to v will also apply to the new vehicle type. VerifyAutoreplaceRefitForOrders (const Vehicle *v, EngineID engine_type) Transfer cargo from a single (articulated )old vehicle to the new vehicle chain. TransferCargo ( Vehicle *old_veh, Vehicle *new_head, bool part_of_chain) More.Ĭheck the capacity of all vehicles in a chain and spread cargo if needed. More.ĮnginesHaveCargoInCommon ( EngineID engine_a, EngineID engine_b)įigure out if two engines got at least one type of cargo in common (refitting if needed) More.ĬheckAutoreplaceValidity ( EngineID from, EngineID to, CompanyID company)Ĭhecks some basic properties whether autoreplace is allowed. Report a change in vehicle IDs (due to autoreplace) to affected vehicle windows. More.ĬhangeVehicleViewWindow ( VehicleID from_index, VehicleID to_index) Report a change in vehicle IDs (due to autoreplace) to affected vehicle news. More.ĬhangeVehicleNews ( VehicleID from_index, VehicleID to_index) Switches viewports following vehicles, which get autoreplaced. ChangeVehicleViewports ( VehicleID from_index, VehicleID to_index)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |