summaryrefslogtreecommitdiff
path: root/src/waypoint.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-01-09 16:55:48 +0000
committerrubidium <rubidium@openttd.org>2008-01-09 16:55:48 +0000
commit46650c54b6a13ef5980eadb24995481f1fd83712 (patch)
treea0181571819fca45c3cc170c7ce718009cb12535 /src/waypoint.cpp
parentb4337eba83e34ddaac29684d78202ae9623e9240 (diff)
downloadopenttd-46650c54b6a13ef5980eadb24995481f1fd83712.tar.xz
(svn r11793) -Codechange: pass the expense type via the CommandCost instead of a global variable. Patch by Noldo (FS#1114).
Diffstat (limited to 'src/waypoint.cpp')
-rw-r--r--src/waypoint.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/waypoint.cpp b/src/waypoint.cpp
index 72e43631c..d7b243f3e 100644
--- a/src/waypoint.cpp
+++ b/src/waypoint.cpp
@@ -163,8 +163,6 @@ CommandCost CmdBuildTrainWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint3
Slope tileh;
Axis axis;
- SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
-
/* if custom gfx are used, make sure it is within bounds */
if (p1 >= GetNumCustomStations(STAT_CLASS_WAYP)) return CMD_ERROR;
@@ -247,7 +245,7 @@ CommandCost CmdBuildTrainWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint3
wp_auto_delete.Detach();
}
- return CommandCost(_price.build_train_depot);
+ return CommandCost(EXPENSES_CONSTRUCTION, _price.build_train_depot);
}
/**
@@ -299,7 +297,7 @@ CommandCost RemoveTrainWaypoint(TileIndex tile, uint32 flags, bool justremove)
YapfNotifyTrackLayoutChange(tile, track);
}
- return CommandCost(_price.remove_train_depot);
+ return CommandCost(EXPENSES_CONSTRUCTION, _price.remove_train_depot);
}
/**
@@ -312,7 +310,6 @@ CommandCost RemoveTrainWaypoint(TileIndex tile, uint32 flags, bool justremove)
*/
CommandCost CmdRemoveTrainWaypoint(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
{
- SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION);
return RemoveTrainWaypoint(tile, flags, true);
}