diff options
author | rubidium <rubidium@openttd.org> | 2009-09-09 08:22:21 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-09-09 08:22:21 +0000 |
commit | f1cc044a4021362f1826378b129ecef1210a6a0d (patch) | |
tree | c98ac2757eb87f4accb3507e31bdf2f446d8e873 /src/economy.cpp | |
parent | 008ffc58dd581839d62331d0281849fc3fcef71d (diff) | |
download | openttd-f1cc044a4021362f1826378b129ecef1210a6a0d.tar.xz |
(svn r17485) -Change [FS2459]: make the performance ratings harder to exploit; only count profitable vehicles and recently serviced stations.
Diffstat (limited to 'src/economy.cpp')
-rw-r--r-- | src/economy.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/economy.cpp b/src/economy.cpp index 205797984..a31595a7e 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -166,7 +166,7 @@ int UpdateCompanyRatingAndValue(Company *c, bool update) FOR_ALL_VEHICLES(v) { if (v->owner != owner) continue; if (IsCompanyBuildableVehicleType(v->type) && v->IsPrimaryVehicle()) { - num++; + if (v->profit_last_year > 0) num++; // For the vehicle score only count profitable vehicles if (v->age > 730) { /* Find the vehicle with the lowest amount of profit */ if (min_profit_first || min_profit > v->profit_last_year) { @@ -191,7 +191,8 @@ int UpdateCompanyRatingAndValue(Company *c, bool update) const Station *st; FOR_ALL_STATIONS(st) { - if (st->owner == owner) num += CountBits((byte)st->facilities); + /* Only count stations that are actually serviced */ + if (st->owner == owner && (st->time_since_load <= 20 || st->time_since_unload <= 20)) num += CountBits((byte)st->facilities); } _score_part[owner][SCORE_STATIONS] = num; } |