forked from mirror/OpenTTD
(svn r23290) -Fix [FS#2379,FS#3569]: Change the centre of train vehicles to depend on the vehicle length instead of being fixed at 4/8th of the original vehicle length to make sure shortened vehicles don't block tiles they shouldn't block.
This commit is contained in:
@@ -962,7 +962,7 @@ static void DoDrawVehicle(const Vehicle *v)
|
||||
}
|
||||
|
||||
AddSortableSpriteToDraw(image, pal, v->x_pos + v->x_offs, v->y_pos + v->y_offs,
|
||||
v->x_extent, v->y_extent, v->z_extent, v->z_pos, shadowed);
|
||||
v->x_extent, v->y_extent, v->z_extent, v->z_pos, shadowed, v->x_bb_offs, v->y_bb_offs);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2213,6 +2213,11 @@ void Vehicle::ShowVisualEffect() const
|
||||
continue;
|
||||
}
|
||||
|
||||
/* The effect offset is relative to a point 4 units behind the vehicle's
|
||||
* front (which is the center of an 8/8 vehicle). Shorter vehicles need a
|
||||
* correction factor. */
|
||||
if (v->type == VEH_TRAIN) effect_offset += (VEHICLE_LENGTH - Train::From(v)->gcache.cached_veh_length) / 2;
|
||||
|
||||
int x = _vehicle_smoke_pos[v->direction] * effect_offset;
|
||||
int y = _vehicle_smoke_pos[(v->direction + 2) % 8] * effect_offset;
|
||||
|
||||
|
Reference in New Issue
Block a user