|
@@ -48,13 +48,13 @@ void DrawShipEngineInfo(int engine, int
|
|
|
SetDParam(2, _cargoc.names_long_p[svi->cargo_type]);
|
|
|
SetDParam(3, svi->capacity);
|
|
|
SetDParam(4, svi->running_cost * _price.ship_running >> 8);
|
|
|
DrawStringMultiCenter(x, y, STR_982E_COST_MAX_SPEED_CAPACITY, maxw);
|
|
|
}
|
|
|
|
|
|
int GetShipImage(Vehicle *v, byte direction)
|
|
|
int GetShipImage(const Vehicle *v, byte direction)
|
|
|
{
|
|
|
int spritenum = v->spritenum;
|
|
|
|
|
|
if (is_custom_sprite(spritenum)) {
|
|
|
int sprite = GetCustomVehicleSprite(v, direction);
|
|
|
|
|
@@ -1029,25 +1029,30 @@ int32 CmdSendShipToDepot(int x, int y, u
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
/** Change the service interval for ships.
|
|
|
* @param x,y unused
|
|
|
* @param p1 vehicle ID that is being service-interval-changed
|
|
|
* @param p2 new service interval
|
|
|
*/
|
|
|
int32 CmdChangeShipServiceInt(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
|
|
{
|
|
|
Vehicle *v;
|
|
|
uint16 serv_int = GetServiceIntervalClamped(p2); /* Double check the service interval from the user-input */
|
|
|
|
|
|
if (!IsVehicleIndex(p1)) return CMD_ERROR;
|
|
|
if (serv_int != p2 || !IsVehicleIndex(p1)) return CMD_ERROR;
|
|
|
|
|
|
v = GetVehicle(p1);
|
|
|
|
|
|
if (v->type != VEH_Ship || !CheckOwnership(v->owner))
|
|
|
return CMD_ERROR;
|
|
|
if (v->type != VEH_Ship || !CheckOwnership(v->owner)) return CMD_ERROR;
|
|
|
|
|
|
if (flags & DC_EXEC) {
|
|
|
v->service_interval = (uint16)p2;
|
|
|
v->service_interval = serv_int;
|
|
|
InvalidateWindowWidget(WC_VEHICLE_DETAILS, v->index, 7);
|
|
|
}
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
|