mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-01-31 11:23:21 +00:00
Fix: Recompute road/railtype availability after disabling the engine
This commit is contained in:
parent
b43cc21214
commit
d8dfa1613f
@ -747,8 +747,14 @@ static void EnableEngineForCompany(EngineID eid, CompanyID company)
|
||||
static void DisableEngineForCompany(EngineID eid, CompanyID company)
|
||||
{
|
||||
Engine *e = Engine::Get(eid);
|
||||
Company *c = Company::Get(company);
|
||||
|
||||
ClrBit(e->company_avail, company);
|
||||
if (e->type == VEH_TRAIN) {
|
||||
c->avail_railtypes = GetCompanyRailtypes(c->index);
|
||||
} else if (e->type == VEH_ROAD) {
|
||||
c->avail_roadtypes = GetCompanyRoadTypes(c->index);
|
||||
}
|
||||
|
||||
if (company == _local_company) {
|
||||
AddRemoveEngineFromAutoreplaceAndBuildWindows(e->type);
|
||||
|
Loading…
Reference in New Issue
Block a user