mirror of https://github.com/OpenTTD/OpenTTD
(svn r22181) -Fix (r20574): following a vehicle with a very high VehicleID was impossible
parent
ee1af659a9
commit
1714e5d509
|
@ -171,7 +171,7 @@ void DeleteWindowViewport(Window *w)
|
||||||
* @param width Width of the viewport
|
* @param width Width of the viewport
|
||||||
* @param height Height of the viewport
|
* @param height Height of the viewport
|
||||||
* @param follow_flags Flags controlling 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.
|
* - If bit 31 is clear, it is a #TileIndex.
|
||||||
* @param zoom Zoomlevel to display
|
* @param zoom Zoomlevel to display
|
||||||
*/
|
*/
|
||||||
|
@ -197,7 +197,7 @@ void InitializeWindowViewport(Window *w, int x, int y,
|
||||||
if (follow_flags & 0x80000000) {
|
if (follow_flags & 0x80000000) {
|
||||||
const Vehicle *veh;
|
const Vehicle *veh;
|
||||||
|
|
||||||
vp->follow_vehicle = (VehicleID)(follow_flags & 0xFFFF);
|
vp->follow_vehicle = (VehicleID)(follow_flags & 0xFFFFF);
|
||||||
veh = Vehicle::Get(vp->follow_vehicle);
|
veh = Vehicle::Get(vp->follow_vehicle);
|
||||||
pt = MapXYZToViewport(vp, veh->x_pos, veh->y_pos, veh->z_pos);
|
pt = MapXYZToViewport(vp, veh->x_pos, veh->y_pos, veh->z_pos);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue