Fix path-only signal cycle mode being ignored when using realistic braking
This commit is contained in:
@@ -284,13 +284,13 @@ static void GenericPlaceSignals(TileIndex tile)
|
|||||||
|
|
||||||
/* Which signals should we cycle through? */
|
/* Which signals should we cycle through? */
|
||||||
SignalCycleGroups cycle_types;
|
SignalCycleGroups cycle_types;
|
||||||
if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC) {
|
if (_settings_client.gui.cycle_signal_types == SIGNAL_CYCLE_PATH) {
|
||||||
|
cycle_types = SCG_PBS;
|
||||||
|
} else if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC) {
|
||||||
cycle_types = SCG_BLOCK | SCG_PBS;
|
cycle_types = SCG_BLOCK | SCG_PBS;
|
||||||
} else if (_settings_client.gui.cycle_signal_types == SIGNAL_CYCLE_ALL) {
|
} else if (_settings_client.gui.cycle_signal_types == SIGNAL_CYCLE_ALL) {
|
||||||
cycle_types = SCG_PBS;
|
cycle_types = SCG_PBS;
|
||||||
if (_settings_client.gui.signal_gui_mode == SIGNAL_GUI_ALL) cycle_types |= SCG_BLOCK;
|
if (_settings_client.gui.signal_gui_mode == SIGNAL_GUI_ALL) cycle_types |= SCG_BLOCK;
|
||||||
} else if (_settings_client.gui.cycle_signal_types == SIGNAL_CYCLE_PATH) {
|
|
||||||
cycle_types = SCG_PBS;
|
|
||||||
} else {
|
} else {
|
||||||
cycle_types = SCG_CURRENT_GROUP;
|
cycle_types = SCG_CURRENT_GROUP;
|
||||||
}
|
}
|
||||||
|
@@ -70,18 +70,18 @@ static const TrackdirBits _enterdir_to_trackdirbits[DIAGDIR_END] = {
|
|||||||
|
|
||||||
SignalType NextSignalType(SignalType cur, SignalCycleGroups which_signals)
|
SignalType NextSignalType(SignalType cur, SignalCycleGroups which_signals)
|
||||||
{
|
{
|
||||||
if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC) {
|
|
||||||
switch (cur) {
|
|
||||||
case SIGTYPE_PBS: return SIGTYPE_PBS_ONEWAY;
|
|
||||||
case SIGTYPE_PBS_ONEWAY: return SIGTYPE_BLOCK;
|
|
||||||
default: return SIGTYPE_PBS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (which_signals == SCG_CURRENT_GROUP) which_signals = IsPbsSignal(cur) ? SCG_PBS : SCG_BLOCK;
|
if (which_signals == SCG_CURRENT_GROUP) which_signals = IsPbsSignal(cur) ? SCG_PBS : SCG_BLOCK;
|
||||||
bool pbs = which_signals & SCG_PBS;
|
bool pbs = which_signals & SCG_PBS;
|
||||||
bool block = which_signals & SCG_BLOCK;
|
bool block = which_signals & SCG_BLOCK;
|
||||||
|
|
||||||
|
if (_settings_game.vehicle.train_braking_model == TBM_REALISTIC) {
|
||||||
|
switch (cur) {
|
||||||
|
case SIGTYPE_PBS: return SIGTYPE_PBS_ONEWAY;
|
||||||
|
case SIGTYPE_PBS_ONEWAY: return block ? SIGTYPE_BLOCK : SIGTYPE_PBS;
|
||||||
|
default: return SIGTYPE_PBS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch(cur) {
|
switch(cur) {
|
||||||
case SIGTYPE_BLOCK: return block ? SIGTYPE_ENTRY : SIGTYPE_PBS;
|
case SIGTYPE_BLOCK: return block ? SIGTYPE_ENTRY : SIGTYPE_PBS;
|
||||||
case SIGTYPE_ENTRY: return block ? SIGTYPE_EXIT : SIGTYPE_PBS;
|
case SIGTYPE_ENTRY: return block ? SIGTYPE_EXIT : SIGTYPE_PBS;
|
||||||
|
Reference in New Issue
Block a user