@@ -734,13 +734,13 @@ enum CargoPaymentRatesWidgets {
struct PaymentRatesGraphWindow : BaseGraphWindow {
PaymentRatesGraphWindow(const WindowDesc *desc, WindowNumber window_number) :
BaseGraphWindow(desc, window_number, 2, 24, 200, false, STR_CURRCOMPACT)
{
uint num_active = 0;
for (CargoID c = 0; c < NUM_CARGO; c++) {
if (GetCargo(c)->IsValid()) num_active++;
if (CargoSpec::Get(c)->IsValid()) num_active++;
}
/* Resize the window to fit the cargo types */
ResizeWindow(this, 0, max(num_active, 12U) * 8);
/* Add widgets for each cargo type */
@@ -784,13 +784,13 @@ struct PaymentRatesGraphWindow : BaseGra
int x = 495;
int y = 24;
uint i = 0;
const CargoSpec *cs = GetCargo(c);
const CargoSpec *cs = CargoSpec::Get(c);
if (!cs->IsValid()) continue;
/* Only draw labels for widgets that exist. If the widget doesn't
* exist then the local company has used the climate cheat or
* changed the NewGRF configuration with this window open. */
if (i + CPW_CARGO_FIRST < this->widget_count) {