summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-18 10:48:15 +0000
committerrubidium <rubidium@openttd.org>2007-06-18 10:48:15 +0000
commit966e2738b9c97bb44276ec90ebfa4a202d67d715 (patch)
treee8ff8f3847b0d29507eeef3450ff752e9b318604 /src/roadveh_cmd.cpp
parentf6be61bb3481419a388d9dcdede16c2b5f77c4a2 (diff)
downloadopenttd-966e2738b9c97bb44276ec90ebfa4a202d67d715.tar.xz
(svn r10197) -Codechange: replace int32 with CommandCost where appropriate.
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 5c5e4023b..e3aacdc38 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -116,7 +116,7 @@ void DrawRoadVehEngine(int x, int y, EngineID engine, SpriteID pal)
DrawSprite(6 + _roadveh_images[spritenum], pal, x, y);
}
-static int32 EstimateRoadVehCost(EngineID engine_type)
+static CommandCost EstimateRoadVehCost(EngineID engine_type)
{
return ((_price.roadveh_base >> 3) * GetEngineProperty(engine_type, 0x11, RoadVehInfo(engine_type)->base_cost)) >> 5;
}
@@ -156,9 +156,9 @@ void RoadVehUpdateCache(Vehicle *v)
* @param p1 bus/truck type being built (engine)
* @param p2 bit 0 when set, the unitnumber will be 0, otherwise it will be a free number
*/
-int32 CmdBuildRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdBuildRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
- int32 cost;
+ CommandCost cost;
Vehicle *v;
UnitID unit_num;
Engine *e;
@@ -282,7 +282,7 @@ int32 CmdBuildRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
* @param p1 road vehicle ID to start/stop
* @param p2 unused
*/
-int32 CmdStartStopRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdStartStopRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
Vehicle *v;
uint16 callback;
@@ -347,7 +347,7 @@ static bool CheckRoadVehInDepotStopped(const Vehicle *v)
* @param p1 vehicle ID to be sold
* @param p2 unused
*/
-int32 CmdSellRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdSellRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
Vehicle *v;
@@ -447,7 +447,7 @@ static const Depot* FindClosestRoadDepot(const Vehicle* v)
* - p2 bit 0-3 - DEPOT_ flags (see vehicle.h)
* - p2 bit 8-10 - VLW flag (for mass goto depot)
*/
-int32 CmdSendRoadVehToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdSendRoadVehToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
Vehicle *v;
const Depot *dep;
@@ -520,7 +520,7 @@ int32 CmdSendRoadVehToDepot(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
* @param p1 vehicle ID to turn
* @param p2 unused
*/
-int32 CmdTurnRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdTurnRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
Vehicle *v;
@@ -1886,7 +1886,7 @@ static void CheckIfRoadVehNeedsService(Vehicle *v)
void OnNewDay_RoadVeh(Vehicle *v)
{
- int32 cost;
+ CommandCost cost;
if (!IsRoadVehFront(v)) return;
@@ -2001,10 +2001,10 @@ void RoadVehiclesYearlyLoop()
* - p2 = (bit 16) - refit only this vehicle (ignored)
* @return cost of refit or error
*/
-int32 CmdRefitRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
+CommandCost CmdRefitRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
Vehicle *v;
- int32 cost;
+ CommandCost cost;
CargoID new_cid = GB(p2, 0, 8);
byte new_subtype = GB(p2, 8, 8);
uint16 capacity = CALLBACK_FAILED;