From 71db9ebc3b32d8b378e2bd1b8f25e1bc68343c50 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 1 Jan 2020 17:13:32 +0000 Subject: [PATCH] NewGRF debug window: Add vehicle cargo and last station lines --- src/table/newgrf_debug_data.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index a7c38645f7..1362857b3a 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -102,6 +102,21 @@ class NIHVehicle : public NIHelper { seprintf(buffer, lastof(buffer), " V Cache: max speed: %u, cargo age period: %u, vis effect: %u", v->vcache.cached_max_speed, v->vcache.cached_cargo_age_period, v->vcache.cached_vis_effect); print(buffer); + if (v->cargo_type != CT_INVALID) { + seprintf(buffer, lastof(buffer), " V Cargo: type: %u, cap: %u, transfer: %u, deliver: %u, keep: %u, load: %u", + v->cargo_type, v->cargo_cap, + v->cargo.ActionCount(VehicleCargoList::MTA_TRANSFER), v->cargo.ActionCount(VehicleCargoList::MTA_DELIVER), + v->cargo.ActionCount(VehicleCargoList::MTA_KEEP), v->cargo.ActionCount(VehicleCargoList::MTA_LOAD)); + print(buffer); + } + if (BaseStation::IsValidID(v->last_station_visited)) { + seprintf(buffer, lastof(buffer), " V Last station visited: %u, %s", v->last_station_visited, BaseStation::Get(v->last_station_visited)->GetCachedName()); + print(buffer); + } + if (BaseStation::IsValidID(v->last_loading_station)) { + seprintf(buffer, lastof(buffer), " V Last loading visited: %u, %s", v->last_loading_station, BaseStation::Get(v->last_loading_station)->GetCachedName()); + print(buffer); + } if (v->IsGroundVehicle()) { const GroundVehicleCache &gvc = *(v->GetGroundVehicleCache()); seprintf(buffer, lastof(buffer), " GV Cache: weight: %u, slope res: %u, max TE: %u, axle res: %u",