summaryrefslogtreecommitdiff
path: root/src/subsidy_gui.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-07-18 19:54:35 +0000
committersmatz <smatz@openttd.org>2009-07-18 19:54:35 +0000
commitaf13707e0085ff0b273a1f1577c4e1855dedfbe1 (patch)
tree23f18152ec75a44d0ba7074cb092c18979a24c09 /src/subsidy_gui.cpp
parent3fcfb9b248bd228d5885974858a14724205626ad (diff)
downloadopenttd-af13707e0085ff0b273a1f1577c4e1855dedfbe1.tar.xz
(svn r16877) -Codechange: use Subsidy::IsAwarded() instead of testing subsidy's age
Diffstat (limited to 'src/subsidy_gui.cpp')
-rw-r--r--src/subsidy_gui.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp
index 392ec2095..3b24625b9 100644
--- a/src/subsidy_gui.cpp
+++ b/src/subsidy_gui.cpp
@@ -47,7 +47,7 @@ struct SubsidyListWindow : Window {
const Subsidy *s;
FOR_ALL_SUBSIDIES(s) {
- if (s->age < 12) {
+ if (!s->IsAwarded()) {
y -= FONT_HEIGHT_NORMAL;
if (y < 0) {
this->HandleClick(s);
@@ -66,7 +66,7 @@ struct SubsidyListWindow : Window {
if (y < 0) return;
FOR_ALL_SUBSIDIES(s) {
- if (s->age >= 12) {
+ if (s->IsAwarded()) {
y -= FONT_HEIGHT_NORMAL;
if (y < 0) {
this->HandleClick(s);
@@ -83,7 +83,7 @@ struct SubsidyListWindow : Window {
/* determine from coordinate for subsidy and try to scroll to it */
uint offs = s->from;
- if (s->age >= 12) {
+ if (s->IsAwarded()) {
xy = Station::Get(offs)->xy;
} else if (te == TE_PASSENGERS || te == TE_MAIL) {
xy = Town::Get(offs)->xy;
@@ -96,7 +96,7 @@ struct SubsidyListWindow : Window {
/* otherwise determine to coordinate for subsidy and scroll to it */
offs = s->to;
- if (s->age >= 12) {
+ if (s->IsAwarded()) {
xy = Station::Get(offs)->xy;
} else if (te == TE_PASSENGERS || te == TE_MAIL || te == TE_GOODS || te == TE_FOOD) {
xy = Town::Get(offs)->xy;
@@ -131,7 +131,7 @@ struct SubsidyListWindow : Window {
uint num = 0;
FOR_ALL_SUBSIDIES(s) {
- if (s->age < 12) {
+ if (!s->IsAwarded()) {
/* Displays the two offered towns */
SetupSubsidyDecodeParam(s, 1);
SetDParam(7, _date - ymd.day + 384 - s->age * 32);
@@ -153,7 +153,7 @@ struct SubsidyListWindow : Window {
num = 0;
FOR_ALL_SUBSIDIES(s) {
- if (s->age >= 12) {
+ if (s->IsAwarded()) {
SetupSubsidyDecodeParam(s, 1);
SetDParam(3, Station::Get(s->to)->owner);
SetDParam(4, _date - ymd.day + 768 - s->age * 32);