equal
deleted
inserted
replaced
1500 * @param p1 vehicle ID to name |
1500 * @param p1 vehicle ID to name |
1501 * @param p2 unused |
1501 * @param p2 unused |
1502 */ |
1502 */ |
1503 CommandCost CmdNameVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) |
1503 CommandCost CmdNameVehicle(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) |
1504 { |
1504 { |
1505 if (!IsValidVehicleID(p1) || StrEmpty(_cmd_text)) return CMD_ERROR; |
1505 if (!IsValidVehicleID(p1)) return CMD_ERROR; |
|
1506 if (StrEmpty(_cmd_text) || strlen(_cmd_text) >= MAX_LENGTH_VEHICLE_NAME_BYTES) return CMD_ERROR; |
1506 |
1507 |
1507 Vehicle *v = GetVehicle(p1); |
1508 Vehicle *v = GetVehicle(p1); |
1508 |
1509 |
1509 if (!CheckOwnership(v->owner)) return CMD_ERROR; |
1510 if (!CheckOwnership(v->owner)) return CMD_ERROR; |
1510 |
1511 |