diff options
-rw-r--r-- | src/engine.cpp | 6 | ||||
-rw-r--r-- | src/newgrf.cpp | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index 37067bdd2..80b07adca 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -332,6 +332,12 @@ static void NewVehicleAvailable(Engine *e) if (p->is_active) SETBIT(p->avail_railtypes, railtype); } } + if ((index - NUM_TRAIN_ENGINES) < NUM_ROAD_ENGINES) { + /* maybe make another road type available */ + FOR_ALL_PLAYERS(p) { + if (p->is_active) SETBIT(p->avail_roadtypes, HASBIT(EngInfo(index)->misc_flags, EF_ROAD_TRAM) ? ROADTYPE_TRAM : ROADTYPE_ROAD); + } + } AddNewsItem(index, NEWS_FLAGS(NM_CALLBACK, 0, NT_NEW_VEHICLES, DNC_VEHICLEAVAIL), 0, 0); } diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 8f0aac2ec..6095832ed 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -4808,6 +4808,13 @@ void InitDepotWindowBlockSizes(); static void AfterLoadGRFs() { + /* Update the bitmasks for the vehicle lists */ + Player *p; + FOR_ALL_PLAYERS(p) { + p->avail_railtypes = GetPlayerRailtypes(p->index); + p->avail_roadtypes = GetPlayerRoadtypes(p->index); + } + /* Pre-calculate all refit masks after loading GRF files. */ CalculateRefitMasks(); |