summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-03-18 21:58:03 +0000
committerpeter1138 <peter1138@openttd.org>2007-03-18 21:58:03 +0000
commitd947f5cec9fee3f1388cc986e7f32afa1e118b18 (patch)
tree44c982c9a10a44112684124935e3a53494236abb /src
parent46fd8ca6447ae367eeb3e6c100ce15c73f37442f (diff)
downloadopenttd-d947f5cec9fee3f1388cc986e7f32afa1e118b18.tar.xz
(svn r9300) -Codechange: Use cargo's town effect property in the subsidy gui
Diffstat (limited to 'src')
-rw-r--r--src/subsidy_gui.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp
index dbf427e66..fc4edec04 100644
--- a/src/subsidy_gui.cpp
+++ b/src/subsidy_gui.cpp
@@ -13,6 +13,7 @@
#include "economy.h"
#include "variables.h"
#include "date.h"
+#include "cargotype.h"
static void HandleSubsidyClick(int y)
{
@@ -50,22 +51,24 @@ static void HandleSubsidyClick(int y)
handle_click:
+ TownEffect te = GetCargo(s->cargo_type)->town_effect;
+
/* determine from coordinate for subsidy and try to scroll to it */
offs = s->from;
if (s->age >= 12) {
xy = GetStation(offs)->xy;
- } else if (s->cargo_type == CT_PASSENGERS || s->cargo_type == CT_MAIL) {
+ } else if (te == TE_PASSENGERS || te == TE_MAIL) {
xy = GetTown(offs)->xy;
} else {
xy = GetIndustry(offs)->xy;
-
}
+
if (!ScrollMainWindowToTile(xy)) {
/* otherwise determine to coordinate for subsidy and scroll to it */
offs = s->to;
if (s->age >= 12) {
xy = GetStation(offs)->xy;
- } else if (s->cargo_type == CT_PASSENGERS || s->cargo_type == CT_MAIL || s->cargo_type == CT_GOODS || s->cargo_type == CT_FOOD) {
+ } else if (te == TE_PASSENGERS || te == TE_MAIL || te == TE_GOODS || te == TE_FOOD) {
xy = GetTown(offs)->xy;
} else {
xy = GetIndustry(offs)->xy;