Don't render switch number and delay for tiles where they are unused

This commit is contained in:
Robert Müller 2023-03-04 12:22:47 +01:00
parent 60c0da7c4d
commit 2e5f37c61b

View file

@ -575,7 +575,7 @@ void CRenderTools::RenderSwitchOverlay(CSwitchTile *pSwitch, int w, int h, float
int c = mx + my * w;
unsigned char Index = pSwitch[c].m_Number;
if(Index)
if(Index && IsSwitchTileNumberUsed(pSwitch[c].m_Type))
{
char aBuf[16];
str_format(aBuf, sizeof(aBuf), "%d", Index);
@ -585,7 +585,7 @@ void CRenderTools::RenderSwitchOverlay(CSwitchTile *pSwitch, int w, int h, float
}
unsigned char Delay = pSwitch[c].m_Delay;
if(Delay)
if(Delay && IsSwitchTileDelayUsed(pSwitch[c].m_Type))
{
char aBuf[16];
str_format(aBuf, sizeof(aBuf), "%d", Delay);