diff --git a/src/engine.cpp b/src/engine.cpp index 627c7b9db4..a63b5a1954 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -1085,22 +1085,13 @@ static void NewVehicleAvailable(Engine *e) * prevent that company from getting future intro periods for a while. */ if (e->flags.Test(EngineFlag::ExclusivePreview)) { for (Company *c : Company::Iterate()) { - uint block_preview = c->block_preview; - if (!e->company_avail.Test(c->index)) continue; - /* We assume the user did NOT build it.. prove me wrong ;) */ - c->block_preview = 20; - - for (const Vehicle *v : Vehicle::Iterate()) { - if (v->type == VEH_TRAIN || v->type == VEH_ROAD || v->type == VEH_SHIP || - (v->type == VEH_AIRCRAFT && Aircraft::From(v)->IsNormalAircraft())) { - if (v->owner == c->index && v->engine_type == index) { - /* The user did prove me wrong, so restore old value */ - c->block_preview = block_preview; - break; - } - } + /* Check the company's 'ALL_GROUP' group statistics. This only includes countable vehicles, which is fine + * as those are the only engines that can be given exclusive previews. */ + if (GetGroupNumEngines(c->index, ALL_GROUP, e->index) == 0) { + /* The company did not build this engine during preview. */ + c->block_preview = 20; } } }