summaryrefslogtreecommitdiff
path: root/unmovable_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2004-11-21 10:49:40 +0000
committertron <tron@openttd.org>2004-11-21 10:49:40 +0000
commit57adc97733fc0cc226f7d8f71c7e6b62dab690e0 (patch)
tree3fa8e5167fbe6804668a83cddbd662bdb0e8de2c /unmovable_cmd.c
parent75d002690ac43c3a1c9bdbd16ca0eb48c9a2c50e (diff)
downloadopenttd-57adc97733fc0cc226f7d8f71c7e6b62dab690e0.tar.xz
(svn r724) Remove restriction that a tile can only accept 3 cargo types.
This especially enables houses to accept passengers, mail, goods AND food. Add string templates for up to 5 cargo types for the tile info window. If more are needed just add them. Simplify (de-uglify) the logic for cargo acceptence for houses and split the goods/food table into two. The acceptance is unmodified, but accepting goods AND food is now trivially possible. The exact amounts have to be decided. This is based on Celestar's changes in the map branch plus some further bits that will be merged there soon.
Diffstat (limited to 'unmovable_cmd.c')
-rw-r--r--unmovable_cmd.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/unmovable_cmd.c b/unmovable_cmd.c
index 5c37ba7ec..34f71bc9d 100644
--- a/unmovable_cmd.c
+++ b/unmovable_cmd.c
@@ -126,7 +126,7 @@ static int32 ClearTile_Unmovable(uint tile, byte flags)
return 0;
}
-static void GetAcceptedCargo_Unmovable(uint tile, AcceptedCargo *ac)
+static void GetAcceptedCargo_Unmovable(uint tile, AcceptedCargo ac)
{
byte m5 = _map5[tile];
uint level; // HQ level (depends on company performance) in the range 1..5.
@@ -143,17 +143,13 @@ static void GetAcceptedCargo_Unmovable(uint tile, AcceptedCargo *ac)
// Top town building generates 10, so to make HQ interesting, the top
// type makes 20.
- ac->type_1 = CT_PASSENGERS;
- ac->amount_1 = level;
- if (!ac->amount_1) ac->amount_1 = 1;
+ ac[CT_PASSENGERS] = max(1, level);
// Top town building generates 4, HQ can make up to 8. The
// proportion passengers:mail is different because such a huge
// commercial building generates unusually high amount of mail
// correspondence per physical visitor.
- ac->type_2 = CT_MAIL;
- ac->amount_2 = level / 2;
- if (!ac->amount_2) ac->amount_2 = 1;
+ ac[CT_MAIL] = max(1, level / 2);
}
static const StringID _unmovable_tile_str[] = {