mirror of https://github.com/OpenTTD/OpenTTD
Fix: [Script] Wrong return value for failed preconditions Vehicle::CloneVehicle
parent
3ae715722c
commit
5ffaf6cdb9
|
@ -109,8 +109,8 @@
|
||||||
|
|
||||||
/* static */ VehicleID ScriptVehicle::CloneVehicle(TileIndex depot, VehicleID vehicle_id, bool share_orders)
|
/* static */ VehicleID ScriptVehicle::CloneVehicle(TileIndex depot, VehicleID vehicle_id, bool share_orders)
|
||||||
{
|
{
|
||||||
EnforceCompanyModeValid(false);
|
EnforceCompanyModeValid(VEHICLE_INVALID);
|
||||||
EnforcePrecondition(false, IsPrimaryVehicle(vehicle_id));
|
EnforcePrecondition(VEHICLE_INVALID, IsPrimaryVehicle(vehicle_id));
|
||||||
|
|
||||||
if (!ScriptObject::Command<CMD_CLONE_VEHICLE>::Do(&ScriptInstance::DoCommandReturnVehicleID, depot, vehicle_id, share_orders)) return VEHICLE_INVALID;
|
if (!ScriptObject::Command<CMD_CLONE_VEHICLE>::Do(&ScriptInstance::DoCommandReturnVehicleID, depot, vehicle_id, share_orders)) return VEHICLE_INVALID;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue