@@ -109,20 +109,13 @@ RoadBits CleanUpRoadBits(const TileIndex
* @return true if company has the requested RoadType available
*/
bool HasRoadTypeAvail(const CompanyID company, RoadType roadtype)
{
if (company == OWNER_DEITY || company == OWNER_TOWN || _game_mode == GM_EDITOR || _generating_world) {
const RoadTypeInfo *rti = GetRoadTypeInfo(roadtype);
if (rti->label == 0) return false;
/*
* Do not allow building hidden road types, except when a town may build it.
* The GS under deity mode, as well as anybody in the editor builds roads that are
* owned by towns. So if a town may build it, it should be buildable by them too.
return (rti->flags & ROTFB_HIDDEN) == 0 || (rti->flags & ROTFB_TOWN_BUILD) != 0;
return rti->label != 0 && (rti->flags & ROTFB_HIDDEN) == 0;
} else {
const Company *c = Company::GetIfValid(company);
if (c == nullptr) return false;
return HasBit(c->avail_roadtypes & ~_roadtypes_hidden_mask, roadtype);
}