### Author Topic: [112.3] Vehicle lengths not summing correctly for needed station size  (Read 1858 times)

0 Members and 1 Guest are viewing this topic.

#### An_dz

• Posts: 2908
• D'oh
• Languages: pt, en, it, (de)
##### [112.3] Vehicle lengths not summing correctly for needed station size
« on: May 19, 2014, 02:06:35 AM »
Flemmbrav found this bug and I have tested it multiple times. Lowest tested version was stable 112.3.

The length of the convoy is not being summed correctly, it only works when using lengths 16 & 8, for example: (Read any real number as a vehicle with length X)

If I buy two 16, or three or four 8, or one 16 with one or two 8, it's calculated correctly and I need a station with two tiles.

But if I buy a 10 & 6, or a 12 & 4 I need two station tiles and not one.

I tested with multiple vehicles with length 2 and here's what I got:
1-5 vehicles: 1 tile
6-13 vehicles: 2 tiles
14-21 vehicles: 3 tiles
22-24 vehicles: 4 tiles

Flemmbrav found this bug because he got a convoy with 6+4+5 and it needed two station tiles and when he appended the same vehicles it still needed 2 tiles.

#### TurfIt

• Dev Team, Coder/patcher
• Devotee
• Posts: 1334
##### Re: [112.3] Vehicle lengths not summing correctly for needed station size
« Reply #1 on: May 19, 2014, 04:07:34 AM »
Intended. But you don't actually need that 'fake' length for loading. You can use the actual length as the length bars show, as long as you accept the rear may still be reserving the track tile before the station.
// the last vehicle counts differently in stations and for reserving track
// (1) add 8 = 127/256 tile to account for the driving in stations in north/west direction
//     see at the end of vehikel_t::hop()
// (2) for length of convoi for loading in stations the length of the last vehicle matters
//     see convoi_t::hat_gehalten

#### An_dz

• Posts: 2908
• D'oh
• Languages: pt, en, it, (de)
##### Re: [112.3] Vehicle lengths not summing correctly for needed station size
« Reply #2 on: May 20, 2014, 12:50:38 AM »
I don't understand why this is being calculated and specially only for north & west. Why steps_next is reduced to its half?

#### Dwachs

• DevTeam, Coder/patcher