summaryrefslogtreecommitdiff
path: root/src/strings.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-02-20 22:09:21 +0000
committerpeter1138 <peter1138@openttd.org>2007-02-20 22:09:21 +0000
commitef2daa5060e251834e82df1ba3e081579ff84f2f (patch)
tree9caff20858ac3f06265e4f69d54b9cdb03a47004 /src/strings.cpp
parent6621beb126c4bf1481b9d7826f3efd10c2bb8308 (diff)
downloadopenttd-ef2daa5060e251834e82df1ba3e081579ff84f2f.tar.xz
(svn r8826) -Codechange: Replace _cargoc's separate arrays with a regular struct array (with accessor) and implement new initialization method using cargo labels.
Diffstat (limited to 'src/strings.cpp')
-rw-r--r--src/strings.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/strings.cpp b/src/strings.cpp
index 3c344239c..9b49b8929 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -17,12 +17,12 @@
#include "industry.h"
#include "variables.h"
#include "newgrf_text.h"
-#include "table/landscape_const.h"
#include "table/control_codes.h"
#include "music.h"
#include "date.h"
#include "industry.h"
#include "helpers.hpp"
+#include "cargotype.h"
/* for opendir/readdir/closedir */
# include "fios.h"
@@ -561,7 +561,7 @@ static char* FormatString(char* buff, const char* str, const int32* argv, uint c
// Short description of cargotypes. Layout:
// 8-bit = cargo type
// 16-bit = cargo count
- StringID cargo_str = _cargo_types_base_values[_opt_ptr->landscape].units_volume[GetInt32(&argv)];
+ StringID cargo_str = GetCargo(GetInt32(&argv))->units_volume;
switch (cargo_str) {
case STR_TONS: {
int32 args[1];
@@ -685,7 +685,7 @@ static char* FormatString(char* buff, const char* str, const int32* argv, uint c
// 8bit - cargo type
// 16-bit - cargo count
CargoID cargo = GetInt32(&argv);
- StringID cargo_str = (cargo == CT_INVALID) ? (StringID)STR_8838_N_A : _cargoc.names_long[cargo];
+ StringID cargo_str = (cargo == CT_INVALID) ? (StringID)STR_8838_N_A : GetCargo(cargo)->quantifier;
buff = GetStringWithArgs(buff, cargo_str, argv++, last);
break;
}