Merge branch 'master' into jgrpp
# Conflicts: # cmake/SourceList.cmake # src/build_vehicle_gui.cpp # src/company_gui.cpp # src/console_cmds.cpp # src/depot_base.h # src/elrail.cpp # src/network/core/udp.cpp # src/network/network_admin.cpp # src/network/network_chat_gui.cpp # src/network/network_gui.cpp # src/network/network_server.cpp # src/newgrf.cpp # src/newgrf_engine.cpp # src/newgrf_railtype.cpp # src/newgrf_railtype.h # src/newgrf_storage.h # src/os/unix/crashlog_unix.cpp # src/rail.h # src/rail_cmd.cpp # src/rail_gui.cpp # src/road_cmd.cpp # src/road_map.h # src/saveload/labelmaps_sl.cpp # src/settings_gui.cpp # src/settings_type.h # src/sl/oldloader_sl.cpp # src/station_cmd.cpp # src/station_gui.cpp # src/table/settings/world_settings.ini # src/tests/test_script_admin.cpp # src/textfile_gui.cpp # src/toolbar_gui.cpp # src/train_cmd.cpp # src/tunnelbridge_cmd.cpp # src/vehicle_gui.cpp # src/widget.cpp # src/window.cpp # src/window_gui.h # src/window_type.h
This commit is contained in:
16
src/rail.cpp
16
src/rail.cpp
@@ -279,7 +279,7 @@ RailType GetTileSecondaryRailTypeIfValid(TileIndex t)
|
||||
* @param railtype requested RailType
|
||||
* @return true if company has requested RailType available
|
||||
*/
|
||||
bool HasRailtypeAvail(const CompanyID company, const RailType railtype)
|
||||
bool HasRailTypeAvail(const CompanyID company, const RailType railtype)
|
||||
{
|
||||
return !HasBit(_railtypes_hidden_mask, railtype) && HasBit(Company::Get(company)->avail_railtypes, railtype);
|
||||
}
|
||||
@@ -289,7 +289,7 @@ bool HasRailtypeAvail(const CompanyID company, const RailType railtype)
|
||||
* @param company the company in question
|
||||
* @return true if company has any RailTypes available
|
||||
*/
|
||||
bool HasAnyRailtypesAvail(const CompanyID company)
|
||||
bool HasAnyRailTypesAvail(const CompanyID company)
|
||||
{
|
||||
return (Company::Get(company)->avail_railtypes & ~_railtypes_hidden_mask) != 0;
|
||||
}
|
||||
@@ -299,9 +299,9 @@ bool HasAnyRailtypesAvail(const CompanyID company)
|
||||
* @param rail the railtype to check.
|
||||
* @return true if the current company may build the rail.
|
||||
*/
|
||||
bool ValParamRailtype(const RailType rail)
|
||||
bool ValParamRailType(const RailType rail)
|
||||
{
|
||||
return rail < RAILTYPE_END && HasRailtypeAvail(_current_company, rail);
|
||||
return rail < RAILTYPE_END && HasRailTypeAvail(_current_company, rail);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -320,7 +320,7 @@ RailTypes AddDateIntroducedRailTypes(RailTypes current, Date date)
|
||||
}
|
||||
|
||||
for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) {
|
||||
const RailtypeInfo *rti = GetRailTypeInfo(rt);
|
||||
const RailTypeInfo *rti = GetRailTypeInfo(rt);
|
||||
/* Unused rail type. */
|
||||
if (rti->label == 0) continue;
|
||||
|
||||
@@ -348,7 +348,7 @@ RailTypes AddDateIntroducedRailTypes(RailTypes current, Date date)
|
||||
* @param introduces If true, include rail types introduced by other rail types
|
||||
* @return the rail types.
|
||||
*/
|
||||
RailTypes GetCompanyRailtypes(CompanyID company, bool introduces)
|
||||
RailTypes GetCompanyRailTypes(CompanyID company, bool introduces)
|
||||
{
|
||||
RailTypes rts = RAILTYPES_NONE;
|
||||
|
||||
@@ -417,14 +417,14 @@ RailType GetRailTypeByLabel(RailTypeLabel label, bool allow_alternate_labels)
|
||||
{
|
||||
/* Loop through each rail type until the label is found */
|
||||
for (RailType r = RAILTYPE_BEGIN; r != RAILTYPE_END; r++) {
|
||||
const RailtypeInfo *rti = GetRailTypeInfo(r);
|
||||
const RailTypeInfo *rti = GetRailTypeInfo(r);
|
||||
if (rti->label == label) return r;
|
||||
}
|
||||
|
||||
if (allow_alternate_labels) {
|
||||
/* Test if any rail type defines the label as an alternate. */
|
||||
for (RailType r = RAILTYPE_BEGIN; r != RAILTYPE_END; r++) {
|
||||
const RailtypeInfo *rti = GetRailTypeInfo(r);
|
||||
const RailTypeInfo *rti = GetRailTypeInfo(r);
|
||||
if (std::find(rti->alternate_labels.begin(), rti->alternate_labels.end(), label) != rti->alternate_labels.end()) return r;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user