Fix restricted signal bit with semaphores for GRF custom signals
This commit is contained in:
@@ -2746,7 +2746,7 @@ void DrawSingleSignal(TileIndex tile, const RailtypeInfo *rti, Track track, Sign
|
|||||||
is_custom_sprite = file != nullptr && (file->flags & SFF_USERGRF) && !(file->flags & SFF_OGFX);
|
is_custom_sprite = file != nullptr && (file->flags & SFF_USERGRF) && !(file->flags & SFF_OGFX);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_custom_sprite && show_restricted && _settings_client.gui.show_restricted_signal_default && !result.restricted_valid) {
|
if (is_custom_sprite && show_restricted && _settings_client.gui.show_restricted_signal_default && !result.restricted_valid && variant == SIG_ELECTRIC) {
|
||||||
/* Use duplicate sprite block, instead of GRF-specified signals */
|
/* Use duplicate sprite block, instead of GRF-specified signals */
|
||||||
if (type == SIGTYPE_PROG) {
|
if (type == SIGTYPE_PROG) {
|
||||||
if (variant == SIG_SEMAPHORE) {
|
if (variant == SIG_SEMAPHORE) {
|
||||||
@@ -2768,7 +2768,7 @@ void DrawSingleSignal(TileIndex tile, const RailtypeInfo *rti, Track track, Sign
|
|||||||
is_custom_sprite = false;
|
is_custom_sprite = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_custom_sprite && show_restricted) {
|
if (!is_custom_sprite && show_restricted && variant == SIG_ELECTRIC) {
|
||||||
if (type == SIGTYPE_PBS || type == SIGTYPE_PBS_ONEWAY) {
|
if (type == SIGTYPE_PBS || type == SIGTYPE_PBS_ONEWAY) {
|
||||||
static const SubSprite lower_part = { -50, -10, 50, 50 };
|
static const SubSprite lower_part = { -50, -10, 50, 50 };
|
||||||
static const SubSprite upper_part = { -50, -50, 50, -11 };
|
static const SubSprite upper_part = { -50, -50, 50, -11 };
|
||||||
@@ -2792,7 +2792,7 @@ static void DrawSingleSignal(TileIndex tile, const RailtypeInfo *rti, Track trac
|
|||||||
SignalType type = GetSignalType(tile, track);
|
SignalType type = GetSignalType(tile, track);
|
||||||
SignalVariant variant = GetSignalVariant(tile, track);
|
SignalVariant variant = GetSignalVariant(tile, track);
|
||||||
|
|
||||||
bool show_restricted = (variant == SIG_ELECTRIC) && IsRestrictedSignal(tile) && (GetExistingTraceRestrictProgram(tile, track) != nullptr);
|
bool show_restricted = IsRestrictedSignal(tile) && (GetExistingTraceRestrictProgram(tile, track) != nullptr);
|
||||||
DrawSingleSignal(tile, rti, track, condition, image, pos, type, variant, show_restricted);
|
DrawSingleSignal(tile, rti, track, condition, image, pos, type, variant, show_restricted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user