diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h index 61b038e2c6..08a9d99d9a 100644 --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -571,6 +571,28 @@ class NIHTown : public NIHelper { return nullptr; } + + void ExtraInfo(uint index, std::function print) const override + { + const Town *t = Town::Get(index); + char buffer[1024]; + + print("Debug Info:"); + seprintf(buffer, lastof(buffer), " Index: %u", index); + print(buffer); + + char *b = buffer; + b += seprintf(b, lastof(buffer), " cargo_produced: "); + SetDParam(0, t->cargo_produced); + b = GetString(b, STR_JUST_CARGO_LIST, lastof(buffer)); + print(buffer); + + b = buffer; + b += seprintf(b, lastof(buffer), " cargo_accepted_total: "); + SetDParam(0, t->cargo_accepted_total); + b = GetString(b, STR_JUST_CARGO_LIST, lastof(buffer)); + print(buffer); + } }; static const NIFeature _nif_town = {