equal
deleted
inserted
replaced
120 return ((_eco->GetPrice(CEconomy::ROADVEH_BASE) >> 3) * RoadVehInfo(engine_type)->base_cost) >> 5; |
120 return ((_eco->GetPrice(CEconomy::ROADVEH_BASE) >> 3) * RoadVehInfo(engine_type)->base_cost) >> 5; |
121 } |
121 } |
122 |
122 |
123 /** Build a road vehicle. |
123 /** Build a road vehicle. |
124 * @param tile tile of depot where road vehicle is built |
124 * @param tile tile of depot where road vehicle is built |
|
125 * @param flags operation to perform |
125 * @param p1 bus/truck type being built (engine) |
126 * @param p1 bus/truck type being built (engine) |
126 * @param p2 bit 0 when set, the unitnumber will be 0, otherwise it will be a free number |
127 * @param p2 bit 0 when set, the unitnumber will be 0, otherwise it will be a free number |
127 */ |
128 */ |
128 int32 CmdBuildRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) |
129 int32 CmdBuildRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) |
129 { |
130 { |
225 return cost; |
226 return cost; |
226 } |
227 } |
227 |
228 |
228 /** Start/Stop a road vehicle. |
229 /** Start/Stop a road vehicle. |
229 * @param tile unused |
230 * @param tile unused |
|
231 * @param flags operation to perform |
230 * @param p1 road vehicle ID to start/stop |
232 * @param p1 road vehicle ID to start/stop |
231 * @param p2 unused |
233 * @param p2 unused |
232 */ |
234 */ |
233 int32 CmdStartStopRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) |
235 int32 CmdStartStopRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) |
234 { |
236 { |
276 DEBUG(ms, 3, "Clearing slot at 0x%X", rs->xy); |
278 DEBUG(ms, 3, "Clearing slot at 0x%X", rs->xy); |
277 } |
279 } |
278 |
280 |
279 /** Sell a road vehicle. |
281 /** Sell a road vehicle. |
280 * @param tile unused |
282 * @param tile unused |
|
283 * @param flags operation to perform |
281 * @param p1 vehicle ID to be sold |
284 * @param p1 vehicle ID to be sold |
282 * @param p2 unused |
285 * @param p2 unused |
283 */ |
286 */ |
284 int32 CmdSellRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) |
287 int32 CmdSellRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) |
285 { |
288 { |
373 } |
376 } |
374 } |
377 } |
375 |
378 |
376 /** Send a road vehicle to the depot. |
379 /** Send a road vehicle to the depot. |
377 * @param tile unused |
380 * @param tile unused |
|
381 * @param flags operation to perform |
378 * @param p1 vehicle ID to send to the depot |
382 * @param p1 vehicle ID to send to the depot |
379 * @param p2 various bitmasked elements |
383 * @param p2 various bitmasked elements |
380 * - p2 bit 0-3 - DEPOT_ flags (see vehicle.h) |
384 * - p2 bit 0-3 - DEPOT_ flags (see vehicle.h) |
381 * - p2 bit 8-10 - VLW flag (for mass goto depot) |
385 * - p2 bit 8-10 - VLW flag (for mass goto depot) |
382 */ |
386 */ |
445 return 0; |
449 return 0; |
446 } |
450 } |
447 |
451 |
448 /** Turn a roadvehicle around. |
452 /** Turn a roadvehicle around. |
449 * @param tile unused |
453 * @param tile unused |
|
454 * @param flags operation to perform |
450 * @param p1 vehicle ID to turn |
455 * @param p1 vehicle ID to turn |
451 * @param p2 unused |
456 * @param p2 unused |
452 */ |
457 */ |
453 int32 CmdTurnRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) |
458 int32 CmdTurnRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) |
454 { |
459 { |
1064 } |
1069 } |
1065 |
1070 |
1066 /** |
1071 /** |
1067 * Returns direction to for a road vehicle to take or |
1072 * Returns direction to for a road vehicle to take or |
1068 * INVALID_TRACKDIR if the direction is currently blocked |
1073 * INVALID_TRACKDIR if the direction is currently blocked |
1069 * @param v the vehicle to do the pathfinding for |
1074 * @param v the Vehicle to do the pathfinding for |
1070 * @param tile the where to start the pathfinding |
1075 * @param tile the where to start the pathfinding |
1071 * @param enterdir the direction the vehicle enters the tile from |
1076 * @param enterdir the direction the vehicle enters the tile from |
1072 * @return the trackdir to take |
1077 * @return the Trackdir to take |
1073 */ |
1078 */ |
1074 static Trackdir RoadFindPathToDest(Vehicle* v, TileIndex tile, DiagDirection enterdir) |
1079 static Trackdir RoadFindPathToDest(Vehicle* v, TileIndex tile, DiagDirection enterdir) |
1075 { |
1080 { |
1076 #define return_track(x) { best_track = (Trackdir)x; goto found_best_track; } |
1081 #define return_track(x) { best_track = (Trackdir)x; goto found_best_track; } |
1077 |
1082 |
1839 } |
1844 } |
1840 } |
1845 } |
1841 |
1846 |
1842 /** Refit a road vehicle to the specified cargo type |
1847 /** Refit a road vehicle to the specified cargo type |
1843 * @param tile unused |
1848 * @param tile unused |
|
1849 * @param flags operation to perform |
1844 * @param p1 Vehicle ID of the vehicle to refit |
1850 * @param p1 Vehicle ID of the vehicle to refit |
1845 * @param p2 Bitstuffed elements |
1851 * @param p2 Bitstuffed elements |
1846 * - p2 = (bit 0-7) - the new cargo type to refit to |
1852 * - p2 = (bit 0-7) - the new cargo type to refit to |
1847 * - p2 = (bit 8-15) - the new cargo subtype to refit to |
1853 * - p2 = (bit 8-15) - the new cargo subtype to refit to |
1848 */ |
1854 */ |