Block signals into blocks with junctions now default to red with realistic braking
This commit is contained in:
@@ -65,6 +65,7 @@
|
|||||||
#include "../settings_func.h"
|
#include "../settings_func.h"
|
||||||
#include "../animated_tile.h"
|
#include "../animated_tile.h"
|
||||||
#include "../company_func.h"
|
#include "../company_func.h"
|
||||||
|
#include "../infrastructure_func.h"
|
||||||
|
|
||||||
|
|
||||||
#include "saveload_internal.h"
|
#include "saveload_internal.h"
|
||||||
@@ -3908,6 +3909,10 @@ bool AfterLoadGame()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!SlXvIsFeaturePresent(XSLFI_REALISTIC_TRAIN_BRAKING, 3) && _settings_game.vehicle.train_braking_model == TBM_REALISTIC) {
|
||||||
|
UpdateAllBlockSignals();
|
||||||
|
}
|
||||||
|
|
||||||
if (SlXvIsFeatureMissing(XSLFI_INFLATION_FIXED_DATES)) {
|
if (SlXvIsFeatureMissing(XSLFI_INFLATION_FIXED_DATES)) {
|
||||||
_settings_game.economy.inflation_fixed_dates = !IsSavegameVersionBefore(SLV_GS_INDUSTRY_CONTROL);
|
_settings_game.economy.inflation_fixed_dates = !IsSavegameVersionBefore(SLV_GS_INDUSTRY_CONTROL);
|
||||||
}
|
}
|
||||||
|
@@ -146,7 +146,7 @@ const SlxiSubChunkInfo _sl_xv_sub_chunk_infos[] = {
|
|||||||
{ XSLFI_ANIMATED_TILE_EXTRA, XSCF_NULL, 1, 1, "animated_tile_extra", nullptr, nullptr, nullptr },
|
{ XSLFI_ANIMATED_TILE_EXTRA, XSCF_NULL, 1, 1, "animated_tile_extra", nullptr, nullptr, nullptr },
|
||||||
{ XSLFI_NEWGRF_INFO_EXTRA, XSCF_NULL, 1, 1, "newgrf_info_extra", nullptr, nullptr, nullptr },
|
{ XSLFI_NEWGRF_INFO_EXTRA, XSCF_NULL, 1, 1, "newgrf_info_extra", nullptr, nullptr, nullptr },
|
||||||
{ XSLFI_INDUSTRY_CARGO_ADJ, XSCF_IGNORABLE_UNKNOWN, 1, 1, "industry_cargo_adj", nullptr, nullptr, nullptr },
|
{ XSLFI_INDUSTRY_CARGO_ADJ, XSCF_IGNORABLE_UNKNOWN, 1, 1, "industry_cargo_adj", nullptr, nullptr, nullptr },
|
||||||
{ XSLFI_REALISTIC_TRAIN_BRAKING,XSCF_NULL, 2, 2, "realistic_train_braking", nullptr, nullptr, "VLKA" },
|
{ XSLFI_REALISTIC_TRAIN_BRAKING,XSCF_NULL, 3, 3, "realistic_train_braking", nullptr, nullptr, "VLKA" },
|
||||||
{ XSLFI_INFLATION_FIXED_DATES, XSCF_IGNORABLE_ALL, 1, 1, "inflation_fixed_dates", nullptr, nullptr, nullptr },
|
{ XSLFI_INFLATION_FIXED_DATES, XSCF_IGNORABLE_ALL, 1, 1, "inflation_fixed_dates", nullptr, nullptr, nullptr },
|
||||||
{ XSLFI_WATER_FLOODING, XSCF_NULL, 2, 2, "water_flooding", nullptr, nullptr, nullptr },
|
{ XSLFI_WATER_FLOODING, XSCF_NULL, 2, 2, "water_flooding", nullptr, nullptr, nullptr },
|
||||||
{ XSLFI_MORE_HOUSES, XSCF_NULL, 2, 2, "more_houses", nullptr, nullptr, nullptr },
|
{ XSLFI_MORE_HOUSES, XSCF_NULL, 2, 2, "more_houses", nullptr, nullptr, nullptr },
|
||||||
|
@@ -274,6 +274,7 @@ enum SigFlags {
|
|||||||
SF_TRAIN = 1 << 0, ///< train found in segment
|
SF_TRAIN = 1 << 0, ///< train found in segment
|
||||||
SF_FULL = 1 << 1, ///< some of buffers was full, do not continue
|
SF_FULL = 1 << 1, ///< some of buffers was full, do not continue
|
||||||
SF_PBS = 1 << 2, ///< pbs signal found
|
SF_PBS = 1 << 2, ///< pbs signal found
|
||||||
|
SF_JUNCTION= 1 << 3, ///< junction found
|
||||||
};
|
};
|
||||||
|
|
||||||
DECLARE_ENUM_AS_BIT_SET(SigFlags)
|
DECLARE_ENUM_AS_BIT_SET(SigFlags)
|
||||||
@@ -370,6 +371,8 @@ static SigInfo ExploreSegment(Owner owner)
|
|||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
} else if (!HasAtMostOneBit(tracks)) {
|
||||||
|
info.flags |= SF_JUNCTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (DiagDirection dir = DIAGDIR_BEGIN; dir < DIAGDIR_END; dir++) { // test all possible exit directions
|
for (DiagDirection dir = DIAGDIR_BEGIN; dir < DIAGDIR_END; dir++) { // test all possible exit directions
|
||||||
@@ -465,6 +468,8 @@ static SigInfo ExploreSegment(Owner owner)
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
} else if (!HasAtMostOneBit(tracks)) {
|
||||||
|
info.flags |= SF_JUNCTION;
|
||||||
}
|
}
|
||||||
if (enterdir == INVALID_DIAGDIR) { // incoming from the wormhole
|
if (enterdir == INVALID_DIAGDIR) { // incoming from the wormhole
|
||||||
if (!(info.flags & SF_TRAIN) && check_train_present(tunnel_bridge_dir)) info.flags |= SF_TRAIN;
|
if (!(info.flags & SF_TRAIN) && check_train_present(tunnel_bridge_dir)) info.flags |= SF_TRAIN;
|
||||||
@@ -519,7 +524,7 @@ static void UpdateSignalsAroundSegment(SigInfo info)
|
|||||||
|
|
||||||
if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC) {
|
if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC) {
|
||||||
if (_tbuset.Items() > 1) info.flags |= SF_PBS;
|
if (_tbuset.Items() > 1) info.flags |= SF_PBS;
|
||||||
if (info.flags & SF_PBS) info.flags |= SF_TRAIN;
|
if (info.flags & (SF_PBS | SF_JUNCTION)) info.flags |= SF_TRAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (_tbuset.Get(&tile, &trackdir)) {
|
while (_tbuset.Get(&tile, &trackdir)) {
|
||||||
|
Reference in New Issue
Block a user