summaryrefslogtreecommitdiff
path: root/src/cargotype.h
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-04-12 17:47:13 +0200
committerglx22 <glx22@users.noreply.github.com>2019-04-18 21:49:34 +0200
commit0797de06be265da4f3bb06114cae4d8e5c830e71 (patch)
tree740b82448bb649fd3b7a57494f85ebc1179b4567 /src/cargotype.h
parentf0b3267615b79dd9301226979812eeed39158e2d (diff)
downloadopenttd-0797de06be265da4f3bb06114cae4d8e5c830e71.tar.xz
Codechange: use std::vector for _sorted_cargo_specs
Diffstat (limited to 'src/cargotype.h')
-rw-r--r--src/cargotype.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cargotype.h b/src/cargotype.h
index b35eef965..aa67561d8 100644
--- a/src/cargotype.h
+++ b/src/cargotype.h
@@ -17,6 +17,7 @@
#include "gfx_type.h"
#include "strings_type.h"
#include "landscape_type.h"
+#include <vector>
/** Globally unique label of a cargo type. */
typedef uint32 CargoLabel;
@@ -137,8 +138,7 @@ CargoID GetCargoIDByLabel(CargoLabel cl);
CargoID GetCargoIDByBitnum(uint8 bitnum);
void InitializeSortedCargoSpecs();
-extern const CargoSpec *_sorted_cargo_specs[NUM_CARGO];
-extern uint8 _sorted_cargo_specs_size;
+extern std::vector<const CargoSpec *> _sorted_cargo_specs;
extern uint8 _sorted_standard_cargo_specs_size;
/**
@@ -163,7 +163,7 @@ static inline bool IsCargoInClass(CargoID c, CargoClass cc)
* @param var Reference getting the cargospec.
* @see CargoSpec
*/
-#define FOR_ALL_SORTED_CARGOSPECS(var) for (uint8 index = 0; index < _sorted_cargo_specs_size && (var = _sorted_cargo_specs[index], true) ; index++)
+#define FOR_ALL_SORTED_CARGOSPECS(var) for (uint8 index = 0; index < _sorted_cargo_specs.size() && (var = _sorted_cargo_specs[index], true) ; index++)
/**
* Loop header for iterating over 'real' cargoes, sorted by name. Phony cargoes like regearing cargoes are skipped.