Skip to content

Commit 44180b5

Browse files
authored
Merge pull request #710 from Sharpe49/fix/get-draw-state
Fix GetDrawState when using upper characters in the name parameter
2 parents f4db4c1 + 81ab87c commit 44180b5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Source/Orts.Simulation/Simulation/Signalling/CsSignalScript.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,14 @@ public enum BlockState
9494
/// <param name="signalAspect">Aspect for which the default draw state must be found</param>
9595
/// <returns></returns>
9696
public int DefaultDrawState(Aspect signalAspect) => SignalHead.def_draw_state((MstsSignalAspect)signalAspect);
97+
9798
/// <summary>
9899
/// Index of the draw state with the specified name
99100
/// </summary>
100101
/// <param name="name">Name of the draw state as defined in sigcfg</param>
101102
/// <returns>The index of the draw state, -1 if no one exist with that name</returns>
102-
public int GetDrawState(string name) => SignalHead.signalType.DrawStates.TryGetValue(name, out SignalDrawState drawState) ? drawState.Index : -1;
103+
public int GetDrawState(string name) => SignalHead.signalType.DrawStates.TryGetValue(name.ToLower(), out SignalDrawState drawState) ? drawState.Index : -1;
104+
103105
/// <summary>
104106
/// Signal identity of this signal
105107
/// </summary>

0 commit comments

Comments
 (0)