Debug: Show all town persistent storage registers, not just the caller GRFID

This commit is contained in:
Jonathan G Rennison
2020-12-29 21:33:51 +00:00
parent aa46bf3a2b
commit 77bf073939
2 changed files with 43 additions and 19 deletions

View File

@@ -543,6 +543,11 @@ class NIHIndustry : public NIHelper {
return (int32 *)(&i->psa->storage);
}
std::vector<uint32> GetPSAGRFIDs(uint index) const override
{
return { 0 };
}
void ExtraInfo(uint index, std::function<void(const char *)> print) const override
{
char buffer[1024];
@@ -866,6 +871,17 @@ class NIHTown : public NIHelper {
return nullptr;
}
virtual std::vector<uint32> GetPSAGRFIDs(uint index) const
{
Town *t = Town::Get(index);
std::vector<uint32> output;
for (const auto &iter : t->psa_list) {
output.push_back(iter->grfid);
}
return output;
}
void ExtraInfo(uint index, std::function<void(const char *)> print) const override
{
const Town *t = Town::Get(index);