From 81e6d68f95e7dea5c0d7dd105d67980d64af71e0 Mon Sep 17 00:00:00 2001 From: tron Date: Mon, 10 Apr 2006 07:15:58 +0000 Subject: (svn r4342) Change the first two parameters of commands - virtual pixel coordinates of the tile to operate on - to a TileIndex Remove DoCommandByTile(), because now it does the same as DoCommand() --- ship_cmd.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'ship_cmd.c') diff --git a/ship_cmd.c b/ship_cmd.c index 190c32b83..c76a39e4a 100644 --- a/ship_cmd.c +++ b/ship_cmd.c @@ -809,16 +809,15 @@ void ShipsYearlyLoop(void) } /** Build a ship. - * @param x,y tile coordinates of depot where ship is built + * @param tile tile of depot where ship is built * @param p1 ship type being built (engine) * @param p2 unused */ -int32 CmdBuildShip(int x, int y, uint32 flags, uint32 p1, uint32 p2) +int32 CmdBuildShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { int32 value; Vehicle *v; UnitID unit_num; - TileIndex tile = TileVirtXY(x, y); Engine *e; if (!IsEngineBuildable(p1, VEH_Ship)) return_cmd_error(STR_ENGINE_NOT_BUILDABLE); @@ -839,6 +838,9 @@ int32 CmdBuildShip(int x, int y, uint32 flags, uint32 p1, uint32 p2) return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME); if (flags & DC_EXEC) { + int x; + int y; + const ShipVehicleInfo *svi = ShipVehInfo(p1); v->unitnumber = unit_num; @@ -897,11 +899,11 @@ int32 CmdBuildShip(int x, int y, uint32 flags, uint32 p1, uint32 p2) } /** Sell a ship. - * @param x,y unused + * @param tile unused * @param p1 vehicle ID to be sold * @param p2 unused */ -int32 CmdSellShip(int x, int y, uint32 flags, uint32 p1, uint32 p2) +int32 CmdSellShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { Vehicle *v; @@ -930,11 +932,11 @@ int32 CmdSellShip(int x, int y, uint32 flags, uint32 p1, uint32 p2) } /** Start/Stop a ship. - * @param x,y unused + * @param tile unused * @param p1 ship ID to start/stop * @param p2 unused */ -int32 CmdStartStopShip(int x, int y, uint32 flags, uint32 p1, uint32 p2) +int32 CmdStartStopShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { Vehicle *v; @@ -959,11 +961,11 @@ int32 CmdStartStopShip(int x, int y, uint32 flags, uint32 p1, uint32 p2) } /** Send a ship to the depot. - * @param x,y unused + * @param tile unused * @param p1 vehicle ID to send to the depot * @param p2 unused */ -int32 CmdSendShipToDepot(int x, int y, uint32 flags, uint32 p1, uint32 p2) +int32 CmdSendShipToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { Vehicle *v; const Depot *dep; @@ -1008,12 +1010,12 @@ int32 CmdSendShipToDepot(int x, int y, uint32 flags, uint32 p1, uint32 p2) /** Refits a ship to the specified cargo type. - * @param x,y unused + * @param tile unused * @param p1 vehicle ID of the ship to refit * @param p2 various bitstuffed elements * - p2 = (bit 0-7) - the new cargo type to refit to (p2 & 0xFF) */ -int32 CmdRefitShip(int x, int y, uint32 flags, uint32 p1, uint32 p2) +int32 CmdRefitShip(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { Vehicle *v; int32 cost; -- cgit v1.2.3-70-g09d2