Fix: CmdSetAutoReplace didn't validate group type and engine type match (#9950)
[openttd-github.git] / src / autoreplace_cmd.h
blobc42e740c9362fcb46130f410d9e113a120757dc4
1 /*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
8 /** @file autoreplace_cmd.h Command definitions related to autoreplace. */
10 #ifndef AUTOREPLACE_CMD_H
11 #define AUTOREPLACE_CMD_H
13 #include "command_type.h"
14 #include "vehicle_type.h"
15 #include "engine_type.h"
16 #include "group_type.h"
18 CommandCost CmdAutoreplaceVehicle(DoCommandFlag flags, VehicleID veh_id);
19 CommandCost CmdSetAutoReplace(DoCommandFlag flags, GroupID id_g, EngineID old_engine_type, EngineID new_engine_type, bool when_old);
21 DEF_CMD_TRAIT(CMD_AUTOREPLACE_VEHICLE, CmdAutoreplaceVehicle, 0, CMDT_VEHICLE_MANAGEMENT)
22 DEF_CMD_TRAIT(CMD_SET_AUTOREPLACE, CmdSetAutoReplace, 0, CMDT_VEHICLE_MANAGEMENT)
24 #endif /* AUTOREPLACE_CMD_H */