diff options
author | tron <tron@openttd.org> | 2006-04-10 07:15:58 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-04-10 07:15:58 +0000 |
commit | 81e6d68f95e7dea5c0d7dd105d67980d64af71e0 (patch) | |
tree | f8613338e934555520fd9b45b411e8a946c5be7a /aircraft_cmd.c | |
parent | 6926bd55fd4f1d36745082b668b052c1b6691ad8 (diff) | |
download | openttd-81e6d68f95e7dea5c0d7dd105d67980d64af71e0.tar.xz |
(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()
Diffstat (limited to 'aircraft_cmd.c')
-rw-r--r-- | aircraft_cmd.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/aircraft_cmd.c b/aircraft_cmd.c index 86b62beaf..13c0bc4a0 100644 --- a/aircraft_cmd.c +++ b/aircraft_cmd.c @@ -130,16 +130,15 @@ static int32 EstimateAircraftCost(EngineID engine_type) /** Build an aircraft. - * @param x,y tile coordinates of depot where aircraft is built + * @param tile tile of depot where aircraft is built * @param p1 aircraft type being built (engine) * @param p2 unused */ -int32 CmdBuildAircraft(int x, int y, uint32 flags, uint32 p1, uint32 p2) +int32 CmdBuildAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { int32 value; Vehicle *vl[3], *v, *u, *w; UnitID unit_num; - TileIndex tile = TileVirtXY(x, y); const AircraftVehicleInfo *avi; Engine *e; @@ -166,6 +165,9 @@ int32 CmdBuildAircraft(int x, int y, uint32 flags, uint32 p1, uint32 p2) return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME); if (flags & DC_EXEC) { + uint x; + uint y; + v = vl[0]; u = vl[1]; @@ -322,11 +324,11 @@ static void DoDeleteAircraft(Vehicle *v) } /** Sell an aircraft. - * @param x,y unused + * @param tile unused * @param p1 vehicle ID to be sold * @param p2 unused */ -int32 CmdSellAircraft(int x, int y, uint32 flags, uint32 p1, uint32 p2) +int32 CmdSellAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { Vehicle *v; @@ -351,11 +353,11 @@ int32 CmdSellAircraft(int x, int y, uint32 flags, uint32 p1, uint32 p2) } /** Start/Stop an aircraft. - * @param x,y unused + * @param tile unused * @param p1 aircraft ID to start/stop * @param p2 unused */ -int32 CmdStartStopAircraft(int x, int y, uint32 flags, uint32 p1, uint32 p2) +int32 CmdStartStopAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { Vehicle *v; @@ -384,14 +386,14 @@ int32 CmdStartStopAircraft(int x, int y, uint32 flags, uint32 p1, uint32 p2) } /** Send an aircraft to the hangar. - * @param x,y unused + * @param tile unused * @param p1 vehicle ID to send to the hangar * @param p2 various bitmasked elements * - p2 = 0 - aircraft goes to the depot and stays there (user command) * - p2 non-zero - aircraft will try to goto a depot, but not stop there (eg forced servicing) * - p2 (bit 17) - aircraft will try to goto a depot at the next airport */ -int32 CmdSendAircraftToHangar(int x, int y, uint32 flags, uint32 p1, uint32 p2) +int32 CmdSendAircraftToHangar(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { Vehicle *v; @@ -447,12 +449,12 @@ int32 CmdSendAircraftToHangar(int x, int y, uint32 flags, uint32 p1, uint32 p2) /** Refits an aircraft to the specified cargo type. - * @param x,y unused + * @param tile unused * @param p1 vehicle ID of the aircraft to refit * @param p2 various bitstuffed elements * - p2 = (bit 0-7) - the new cargo type to refit to */ -int32 CmdRefitAircraft(int x, int y, uint32 flags, uint32 p1, uint32 p2) +int32 CmdRefitAircraft(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) { Vehicle *v; int pass, mail; |