Pyrdacor / Ambermoon.net

Ambermoon rewrite in C#
GNU General Public License v3.0
424 stars 22 forks source link

[Bug report] Crash when accidentally entering \ in the time to wait dialog #352

Closed orgi closed 1 year ago

orgi commented 1 year ago

Describe the bug Crash when accidentally entering \ instead of a time to wait when wanting to wait for a certain amount of time

To Reproduce Steps to reproduce the behavior:

  1. Press to the hourglass icon when in a dungeon (maybe works outside, too?)
  2. Click into the 'How many hours to wait' box.
  3. Press the \ button on your keyboard
  4. Game will crash. Following error will be shown: DATA UNSUPPORTED TEXT CHARACTER ' '

Stack Trace:

[Data] Unsupported text character '\'.
   at Ambermoon.Data.Legacy.TextProcessor.CharToGlyph(Char ch, Boolean rune, Nullable`1 fallbackChar)+MoveNext()
   at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext()
   at Ambermoon.Data.Legacy.TextProcessor.FinalizeText(IEnumerable`1 glyphs)
   at Ambermoon.UI.TextInput.UpdateText()
   at Ambermoon.UI.TextInput.KeyChar(Char ch)
   at Ambermoon.UI.Popup.KeyChar(Char ch)
   at Ambermoon.UI.Layout.KeyChar(Char ch)
   at Ambermoon.Game.OnKeyChar(Char keyChar)
   at Ambermoon.GameWindow.Keyboard_KeyChar(IKeyboard keyboard, Char keyChar)
   at Silk.NET.Input.Glfw.GlfwKeyboard.<Subscribe>b__31_0(WindowHandle* _, UInt32 c)
   at Silk.NET.Input.Glfw.GlfwEvents.<.ctor>b__0_0(WindowHandle* a, UInt32 b)
   at Silk.NET.GLFW.Glfw.PollEvents()
   at Silk.NET.Windowing.Internals.ViewImplementationBase.Silk.NET.Windowing.IView.DoEvents()
   at Silk.NET.Windowing.WindowExtensions.<>c__DisplayClass2_0.<Run>b__0()
   at Silk.NET.Windowing.Internals.ViewImplementationBase.Run(Action onFrame)
   at Silk.NET.Windowing.WindowExtensions.Run(IView view)
   at Ambermoon.GameWindow.Run(Configuration configuration)
   at Ambermoon.Program.Main()
Press return to exit

Expected behavior No error

Desktop (please complete the following information):

Pyrdacor commented 1 year ago

Good catch. This was introduced with a recent version and I found the cause and could fix it. Will be part of the next release.

Pyrdacor commented 1 year ago

P.S: Thank you very much for sponsoring. Really appreciate it. :)

Pyrdacor commented 1 year ago

Fixed in 1.8.4