summaryrefslogtreecommitdiff
path: root/economy.c
diff options
context:
space:
mode:
authorludde <ludde@openttd.org>2005-07-15 18:30:13 +0000
committerludde <ludde@openttd.org>2005-07-15 18:30:13 +0000
commit3486e7e9d5d24e2e0595b7a8d517581b926b85cd (patch)
tree77cbbb71361c4ceb1306dc06c65b6364221d6c2f /economy.c
parent157addf5e9d85e513355edb97d513443ba9c131f (diff)
downloadopenttd-3486e7e9d5d24e2e0595b7a8d517581b926b85cd.tar.xz
(svn r2580) Change: Added {INDUSTRY} command for printing industry names instead of the old {TOWN} {STRING} way.
- The formatting of the industry name can be controlled with the string STR_INDUSTRY_FORMAT. Change: Changed several occurences of {STRING1} into {TOWN} to get rid of townnametype being used directly.
Diffstat (limited to 'economy.c')
-rw-r--r--economy.c52
1 files changed, 20 insertions, 32 deletions
diff --git a/economy.c b/economy.c
index 4251626ec..1ae1cc5ed 100644
--- a/economy.c
+++ b/economy.c
@@ -794,9 +794,6 @@ Pair SetupSubsidyDecodeParam(Subsidy *s, bool mode)
{
TileIndex tile;
TileIndex tile2;
- Industry *i;
- Town *t;
- Station *st;
Pair tp;
/* if mode is false, convert into plural */
@@ -804,43 +801,34 @@ Pair SetupSubsidyDecodeParam(Subsidy *s, bool mode)
if (s->age < 12) {
if (!(s->cargo_type == CT_PASSENGERS || s->cargo_type == CT_MAIL)) {
- SetDParam(1, STR_2029);
- i = GetIndustry(s->from);
- tile = i->xy;
- SetDParam(2, i->town->index);
- SetDParam(3, i->type + STR_4802_COAL_MINE);
+ SetDParam(1, STR_INDUSTRY);
+ SetDParam(2, s->from);
+ tile = GetIndustry(s->from)->xy;
if (s->cargo_type != CT_GOODS && s->cargo_type != CT_FOOD) {
- SetDParam(4, STR_2029);
- i = GetIndustry(s->to);
- tile2 = i->xy;
- SetDParam(5, i->town->index);
- SetDParam(6, i->type + STR_4802_COAL_MINE);
+ SetDParam(4, STR_INDUSTRY);
+ SetDParam(5, s->to);
+ tile2 = GetIndustry(s->to)->xy;
} else {
- t = GetTown(s->to);
- tile2 = t->xy;
- SetDParam(4, t->townnametype);
- SetDParam(5, t->townnameparts);
+ SetDParam(4, STR_TOWN);
+ SetDParam(5, s->to);
+ tile2 = GetTown(s->to)->xy;
}
} else {
- t = GetTown(s->from);
- tile = t->xy;
- SetDParam(1, t->townnametype);
- SetDParam(2, t->townnameparts);
-
- t = GetTown(s->to);
- tile2 = t->xy;
- SetDParam(4, t->townnametype);
- SetDParam(5, t->townnameparts);
+ SetDParam(1, STR_TOWN);
+ SetDParam(2, s->from);
+ tile = GetTown(s->from)->xy;
+
+ SetDParam(4, STR_TOWN);
+ SetDParam(5, s->to);
+ tile2 = GetTown(s->to)->xy;
}
} else {
- st = GetStation(s->from);
- tile = st->xy;
- SetDParam(1, st->index);
+ SetDParam(1, s->from);
+ tile = GetStation(s->from)->xy;
- st = GetStation(s->to);
- tile2 = st->xy;
- SetDParam(2, st->index);
+ SetDParam(2, s->to);
+ tile2 = GetStation(s->to)->xy;
}
tp.a = tile;