diff options
author | dP <dp@dpointer.org> | 2021-04-11 20:38:29 +0300 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-04-17 22:26:11 +0200 |
commit | 7c7c6cde0344298d7144c85fb97ec9123f32fdca (patch) | |
tree | d0a0e6fbabaa804716cb28f098b9d6b93e945aeb | |
parent | e5fedcd6dab98d6ba6e225ab6a05fd5b05fd3edd (diff) | |
download | openttd-7c7c6cde0344298d7144c85fb97ec9123f32fdca.tar.xz |
Fix: Do not unlock railtypes when enabling wagons with GameScript
-rw-r--r-- | src/engine.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index 596e87063..60b0d4222 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -722,11 +722,9 @@ static void EnableEngineForCompany(EngineID eid, CompanyID company) SetBit(e->company_avail, company); if (e->type == VEH_TRAIN) { - assert(e->u.rail.railtype < RAILTYPE_END); - c->avail_railtypes = AddDateIntroducedRailTypes(c->avail_railtypes | GetRailTypeInfo(e->u.rail.railtype)->introduces_railtypes, _date); + c->avail_railtypes = GetCompanyRailtypes(c->index); } else if (e->type == VEH_ROAD) { - assert(e->u.road.roadtype < ROADTYPE_END); - c->avail_roadtypes = AddDateIntroducedRoadTypes(c->avail_roadtypes | GetRoadTypeInfo(e->u.road.roadtype)->introduces_roadtypes, _date); + c->avail_roadtypes = GetCompanyRoadTypes(c->index); } if (company == _local_company) { |