Feature: Add NotRoadTypes (NRT)

This commit is contained in:
peter1138
2019-04-06 07:46:15 +01:00
committed by Michael Lutz
parent 21edf67f89
commit c02ef3e456
106 changed files with 4465 additions and 1245 deletions

View File

@@ -20,6 +20,7 @@
#include "articulated_vehicles.h"
#include "core/random_func.hpp"
#include "vehiclelist.h"
#include "road.h"
#include "table/strings.h"
@@ -74,6 +75,9 @@ bool CheckAutoreplaceValidity(EngineID from, EngineID to, CompanyID company)
}
case VEH_ROAD:
/* make sure the roadtypes are compatible */
if ((GetRoadTypeInfo(e_from->u.road.roadtype)->powered_roadtypes & GetRoadTypeInfo(e_to->u.road.roadtype)->powered_roadtypes) == ROADTYPES_NONE) return false;
/* make sure that we do not replace a tram with a normal road vehicles or vice versa */
if (HasBit(e_from->info.misc_flags, EF_ROAD_TRAM) != HasBit(e_to->info.misc_flags, EF_ROAD_TRAM)) return false;
break;