The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Simutrans-Extended bug reports => Topic started by: CK on January 10, 2020, 04:12:35 PM

Title: [Bug] Capacities in vehicle replace window don't increase beyond original
Post by: CK on January 10, 2020, 04:12:35 PM
The capacities (both passenger, mail and goods) of a convoy do not increase beyond the capacity of the original (to be replaced) convoy in the replace vehicle window. It's a cosmetic bug but nonetheless a bit annoying.

Steps to reproduce:
Title: Re: [Bug] Capacities in vehicle replace window don't increase beyond original
Post by: RESTRICTED ACCOUNT on January 16, 2020, 11:02:33 AM
https://github.com/jamespetts/simutrans-extended/blob/7e076b469ad6c5e8e330f4f1d98478a20c26aa40/gui/components/gui_convoy_assembler.cc#L788
cnv-> get_vehicle_count() in this line does not return the expected value in the replace_frame case.

This seems to be due to counting taking into account the class changes applied in the class manager for the purpose of counting capacity with the code below, if so, in the case of a replace frame, I think we need to add code to count the capacity based on vehicles(vehicle_desc_t *desc).
There may be a smarter way, but at least the current code behaves as reported as a bug. (´・ω・`)