summaryrefslogtreecommitdiff
path: root/vehicle.c
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2006-04-03 09:07:21 +0000
committercelestar <celestar@openttd.org>2006-04-03 09:07:21 +0000
commitcc87f682b9cd9c25ee58cec1b63792e4ef786aa9 (patch)
treee106242c0ac31fc61254791e0f6fcfe95db2baad /vehicle.c
parent3aa1e38be6e0a3c01346fe4db1bb92b148d0f2a9 (diff)
downloadopenttd-cc87f682b9cd9c25ee58cec1b63792e4ef786aa9.tar.xz
(svn r4249) -Codechange: Replace more occurences of 16 by TILE_SIZE and of 8 by TILE_HEIGHT. Reverted one change from the previous commit because it was faulty
Diffstat (limited to 'vehicle.c')
-rw-r--r--vehicle.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/vehicle.c b/vehicle.c
index 303a03253..d8aac3e1b 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -1728,7 +1728,10 @@ static void MaybeReplaceVehicle(Vehicle *v)
* If it's not a train, the value is unused
* round up to the length of the tiles used for the train instead of the train length instead
* Useful when newGRF uses custom length */
- uint16 old_total_length = (v->type == VEH_Train) ? ((v->u.rail.cached_total_length + 15 )/ 16)* 16 : -1;
+ uint16 old_total_length = (v->type == VEH_Train ?
+ (v->u.rail.cached_total_length + TILE_SIZE - 1) / TILE_SIZE * TILE_SIZE :
+ -1
+ );
_current_player = v->owner;