1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-16 17:02:37 +01:00

Add: Town cargo history graphs. (#14461)

This commit is contained in:
Peter Nelson
2025-08-02 23:19:43 +01:00
committed by GitHub
parent aac3a5b683
commit bd57aee3a9
13 changed files with 387 additions and 63 deletions

View File

@@ -93,7 +93,10 @@
const Town *t = ::Town::Get(town_id);
return t->supplied[cargo_type].old_max;
auto it = t->GetCargoSupplied(cargo_type);
if (it == std::end(t->supplied)) return 0;
return it->history[LAST_MONTH].production;
}
/* static */ SQInteger ScriptTown::GetLastMonthSupplied(TownID town_id, CargoType cargo_type)
@@ -103,7 +106,10 @@
const Town *t = ::Town::Get(town_id);
return t->supplied[cargo_type].old_act;
auto it = t->GetCargoSupplied(cargo_type);
if (it == std::end(t->supplied)) return 0;
return it->history[LAST_MONTH].transported;
}
/* static */ SQInteger ScriptTown::GetLastMonthTransportedPercentage(TownID town_id, CargoType cargo_type)