Fix displayed capacities/weights of articulated vehicles in build window

Simplify handling of multi-part capacities and refits

See: https://github.com/OpenTTD/OpenTTD/issues/9954
See: https://github.com/OpenTTD/OpenTTD/issues/10032
This commit is contained in:
Jonathan G Rennison
2022-09-16 20:10:53 +01:00
parent f61562efef
commit c7e4dbf2f6
8 changed files with 62 additions and 57 deletions

View File

@@ -19,6 +19,7 @@
#include "newgrf_config.h"
#include "track_type.h"
#include "livery.h"
#include "cargo_type.h"
#define is_custom_sprite(x) (x >= 0xFD)
#define IS_CUSTOM_FIRSTHEAD_SPRITE(x) (x == 0xFD)
@@ -245,6 +246,7 @@ CommandCost EnsureNoTrainOnTrackBits(TileIndex tile, TrackBits track_bits);
extern VehicleID _new_vehicle_id;
extern uint _returned_refit_capacity;
extern uint16 _returned_mail_refit_capacity;
extern CargoArray _returned_vehicle_capacities;
bool CanVehicleUseStation(EngineID engine_type, const struct Station *st);
bool CanVehicleUseStation(const Vehicle *v, const struct Station *st);