From a7083e9e4a4fa9a0aaad67dc18b5eecd9889f0f5 Mon Sep 17 00:00:00 2001 From: dP Date: Sun, 4 Feb 2024 13:28:57 +0530 Subject: [PATCH] Codechange: Replace magic value with a variable --- src/graph_gui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index e724dd6b9c..e04be5be17 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -1122,7 +1122,7 @@ struct PaymentRatesGraphWindow : BaseGraphWindow { int i = 0; for (const CargoSpec *cs : _sorted_standard_cargo_specs) { this->colours[i] = cs->legend_colour; - for (uint j = 0; j != 20; j++) { + for (uint j = 0; j != this->num_on_x_axis; j++) { this->cost[i][j] = GetTransportedGoodsIncome(10, 20, j * 4 + 4, cs->Index()); } i++;