summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2011-03-04 12:12:48 +0000
committeryexo <yexo@openttd.org>2011-03-04 12:12:48 +0000
commit1714e5d509f136cb67f37a5f0de49da87f0bae26 (patch)
tree691423424bff0e0bc4e77260668d98ff16cd3c65
parentee1af659a911cc7f971ceea56dafb7d5e92a457d (diff)
downloadopenttd-1714e5d509f136cb67f37a5f0de49da87f0bae26.tar.xz
(svn r22181) -Fix (r20574): following a vehicle with a very high VehicleID was impossible
-rw-r--r--src/viewport.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp
index 352fe8ea8..1360064f5 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -171,7 +171,7 @@ void DeleteWindowViewport(Window *w)
* @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 @@ void InitializeWindowViewport(Window *w, int x, int y,
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 {