summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstormcone <48624099+stormcone@users.noreply.github.com>2019-03-23 17:40:01 +0100
committerMichael Lutz <michi@icosahedron.de>2019-03-25 23:41:06 +0100
commit8acca3a72ba4569607575aa5a74bdbbcdb5669f8 (patch)
tree6693786f1caec39fdca6cd36c2137a834f861843
parent698241e16e12bdb03cdc90bdf3d5a6ff631ae309 (diff)
downloadopenttd-8acca3a72ba4569607575aa5a74bdbbcdb5669f8.tar.xz
Change: Do not display a newspaper about old vehicles for which replacement is activated.
-rw-r--r--src/vehicle.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index f4dc0c4dd..4f987a4bf 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -1348,8 +1348,11 @@ void AgeVehicle(Vehicle *v)
/* Don't warn about non-primary or not ours vehicles or vehicles that are crashed */
if (v->Previous() != NULL || v->owner != _local_company || (v->vehstatus & VS_CRASHED) != 0) return;
+ const Company *c = Company::Get(v->owner);
/* Don't warn if a renew is active */
- if (Company::Get(v->owner)->settings.engine_renew && v->GetEngine()->company_avail != 0) return;
+ if (c->settings.engine_renew && v->GetEngine()->company_avail != 0) return;
+ /* Don't warn if a replacement is active */
+ if (EngineHasReplacementForCompany(c, v->engine_type, v->group_id)) return;
StringID str;
if (age == -DAYS_IN_LEAP_YEAR) {