changeset 17430:5c204fdd9ddb draft

(svn r22181) -Fix (r20574): following a vehicle with a very high VehicleID was impossible
author yexo <yexo@openttd.org>
date Fri, 04 Mar 2011 12:12:48 +0000
parents 2dc9702a19cf
children 316dc19f29d4
files src/viewport.cpp
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -171,7 +171,7 @@
  * @param width Width of the viewport
  * @param height Height of the viewport
  * @param follow_flags Flags controlling the viewport.
- *        - If bit 31 is set, the lower 16 bits are the vehicle that the viewport should follow.
+ *        - If bit 31 is set, the lower 20 bits are the vehicle that the viewport should follow.
  *        - If bit 31 is clear, it is a #TileIndex.
  * @param zoom Zoomlevel to display
  */
@@ -197,7 +197,7 @@
 	if (follow_flags & 0x80000000) {
 		const Vehicle *veh;
 
-		vp->follow_vehicle = (VehicleID)(follow_flags & 0xFFFF);
+		vp->follow_vehicle = (VehicleID)(follow_flags & 0xFFFFF);
 		veh = Vehicle::Get(vp->follow_vehicle);
 		pt = MapXYZToViewport(vp, veh->x_pos, veh->y_pos, veh->z_pos);
 	} else {