summaryrefslogtreecommitdiff
path: root/src/subsidy_gui.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-08-08 16:42:55 +0000
committersmatz <smatz@openttd.org>2009-08-08 16:42:55 +0000
commit2a430d981f680485b9d4f9e5fab8bc642952b9bf (patch)
treee37f617ae610677d7c92aad77b5f184545599102 /src/subsidy_gui.cpp
parenteff8cb839072c3aa80d1e54b189810061160669a (diff)
downloadopenttd-2a430d981f680485b9d4f9e5fab8bc642952b9bf.tar.xz
(svn r17113) -Change [FS#265][FS#2094][FS#2589]: apply the subsidy when subsidy's destination is in station's catchment area and cargo packets originate from subsidy's source
-Change [FS#1134]: subsidies aren't bound to stations after awarding anymore, they still apply to town or industry, no matter what station is used for loading and unloading. Awarded subsidies from older savegames are lost -Change [NoAI]: due to these changes, AISubsidy::GetSource and AISubsidy::GetDestination now return STATION_INVALID for awarded subsidies
Diffstat (limited to 'src/subsidy_gui.cpp')
-rw-r--r--src/subsidy_gui.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp
index de7d71c57..becc4d97a 100644
--- a/src/subsidy_gui.cpp
+++ b/src/subsidy_gui.cpp
@@ -83,7 +83,6 @@ struct SubsidyListWindow : Window {
switch (s->src_type) {
case ST_INDUSTRY: xy = Industry::Get(s->src)->xy; break;
case ST_TOWN: xy = Town::Get(s->src)->xy; break;
- case ST_STATION: xy = Station::Get(s->src)->xy; break;
default: NOT_REACHED();
}
@@ -94,11 +93,9 @@ struct SubsidyListWindow : Window {
switch (s->dst_type) {
case ST_INDUSTRY: xy = Industry::Get(s->dst)->xy; break;
case ST_TOWN: xy = Town::Get(s->dst)->xy; break;
- case ST_STATION: xy = Station::Get(s->dst)->xy; break;
default: NOT_REACHED();
}
-
if (_ctrl_pressed) {
ShowExtraViewPortWindow(xy);
} else {
@@ -129,7 +126,7 @@ struct SubsidyListWindow : Window {
if (!s->IsAwarded()) {
/* Displays the two offered towns */
SetupSubsidyDecodeParam(s, 1);
- SetDParam(7, _date - ymd.day + 384 - s->age * 32);
+ SetDParam(7, _date - ymd.day + s->remaining * 32);
DrawString(x + 2, right - 2, y, STR_SUBSIDIES_OFFERED_FROM_TO);
y += FONT_HEIGHT_NORMAL;
@@ -150,8 +147,8 @@ struct SubsidyListWindow : Window {
FOR_ALL_SUBSIDIES(s) {
if (s->IsAwarded()) {
SetupSubsidyDecodeParam(s, 1);
- SetDParam(3, Station::Get(s->dst)->owner);
- SetDParam(4, _date - ymd.day + 768 - s->age * 32);
+ SetDParam(7, s->awarded);
+ SetDParam(8, _date - ymd.day + s->remaining * 32);
/* Displays the two connected stations */
DrawString(x + 2, right - 2, y, STR_SUBSIDIES_SUBSIDISED_FROM_TO);