diff --git a/src/autoreplace_cmd.cpp b/src/autoreplace_cmd.cpp --- a/src/autoreplace_cmd.cpp +++ b/src/autoreplace_cmd.cpp @@ -608,7 +608,7 @@ CommandCost CmdAutoreplaceVehicle(TileIn CommandCost cost = CommandCost(EXPENSES_NEW_VEHICLES, 0); bool nothing_to_do = true; - if (!IsValidVehicleID(p1)) return CMD_ERROR; + if (!Vehicle::IsValidID(p1)) return CMD_ERROR; Vehicle *v = Vehicle::Get(p1); if (!CheckOwnership(v->owner)) return CMD_ERROR; if (!v->IsInDepot()) return CMD_ERROR;