summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-03-07 18:24:41 +0000
committeralberth <alberth@openttd.org>2010-03-07 18:24:41 +0000
commit55f8d5d80234bbeb7668c6d3263687185cd263d9 (patch)
tree8dfcf7d8ca049547e39e95a32edd6be55fbfd834 /src/vehicle.cpp
parentf0de6366bac6857a85fe1677fb6703b8be187be4 (diff)
downloadopenttd-55f8d5d80234bbeb7668c6d3263687185cd263d9.tar.xz
(svn r19369) -Codechange: EnsureNoTrainOnTrackBits() returns a CommandCost now.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 312813c36..44e3991ff 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -472,15 +472,15 @@ static Vehicle *EnsureNoTrainOnTrackProc(Vehicle *v, void *data)
* @param track_bits The track bits.
* @return \c true if no train that interacts, is found. \c false if a train is found.
*/
-bool EnsureNoTrainOnTrackBits(TileIndex tile, TrackBits track_bits)
+CommandCost EnsureNoTrainOnTrackBits(TileIndex tile, TrackBits track_bits)
{
/* Value v is not safe in MP games, however, it is used to generate a local
* error message only (which may be different for different machines).
* Such a message does not affect MP synchronisation.
*/
Vehicle *v = VehicleFromPos(tile, &track_bits, &EnsureNoTrainOnTrackProc, true);
- if (v != NULL) _error_message = STR_ERROR_TRAIN_IN_THE_WAY + v->type;
- return v == NULL;
+ if (v != NULL) return_cmd_error(STR_ERROR_TRAIN_IN_THE_WAY + v->type);
+ return CommandCost();
}
static void UpdateNewVehiclePosHash(Vehicle *v, bool remove)