Fushigi icon indicating copy to clipboard operation
Fushigi copied to clipboard

CLR/System.InvalidCastException After placing any rails

Open jacobamobin opened this issue 2 years ago • 0 comments

An unhandled exception of type 'System.InvalidCastException' occurred in System.Private.CoreLib.dll: 'Unable to cast object of type 'Fushigi.Byml.BymlNode1[System.Int32]' to type 'Fushigi.Byml.BymlNode1[System.UInt32]'.'

After placing a rail in my level, or multiple and then closing the editor or switching levels everything works as expected, from there i can open the editor and go back to my level fine, but the seccond time i do it, in any version of fushigi (tilemapbranch, main, v0.3-0.4-0.5-0.6) i get a Invalid cast exception every time from there on. This bug happens without any actor to rail links, and happens with both assistant rails present and unpresent in the level

Steps to reproduce the behavior:

  1. Create a new rail and add a few points (one the level didnt have before)
  2. Save the level
  3. Close Fushigi
  4. Open Fushigi
  5. Save the level
  6. Close Fushigi
  7. Fushigi will not open on the seccond time, instead i get the error on the first line of this post

Expected behavior Fushigi Opens and loads the level with all the rails, including the new ones i made

Code_nrjmv4vfew

OS: Windows 11

Additional context Its very odd it opens on the first time after adding the rail then breaks every time after that

Error

Exception has occurred: CLR/System.InvalidCastException An unhandled exception of type 'System.InvalidCastException' occurred in System.Private.CoreLib.dll: 'Unable to cast object of type 'Fushigi.Byml.BymlNode1[System.Int32]' to type 'Fushigi.Byml.BymlNode1[System.UInt32]'.' at Fushigi.util.BymlUtil.GetNodeData[T](IBymlNode node) in C:\Users\jacob\Downloads\Fushigi-Bfres-Tile-Rendering\Fushigi-Bfres-Tile-Rendering\Fushigi\util\BymlUtil.cs:line 21 at Fushigi.util.BymlUtil.GetValueFromDynamicNode(IBymlNode node, String dynNode, String type) in C:\Users\jacob\Downloads\Fushigi-Bfres-Tile-Rendering\Fushigi-Bfres-Tile-Rendering\Fushigi\util\BymlUtil.cs:line 75 at Fushigi.course.CourseRail.CourseRailPoint..ctor(BymlHashTable node, String pointParam) in C:\Users\jacob\Downloads\Fushigi-Bfres-Tile-Rendering\Fushigi-Bfres-Tile-Rendering\Fushigi\course\CourseRail.cs:line 240 at Fushigi.course.CourseRail..ctor(BymlHashTable node) in C:\Users\jacob\Downloads\Fushigi-Bfres-Tile-Rendering\Fushigi-Bfres-Tile-Rendering\Fushigi\course\CourseRail.cs:line 102 at Fushigi.course.CourseRailHolder..ctor(BymlArrayNode railArray) in C:\Users\jacob\Downloads\Fushigi-Bfres-Tile-Rendering\Fushigi-Bfres-Tile-Rendering\Fushigi\course\CourseRail.cs:line 326 at Fushigi.course.CourseArea.Load() in C:\Users\jacob\Downloads\Fushigi-Bfres-Tile-Rendering\Fushigi-Bfres-Tile-Rendering\Fushigi\course\CourseArea.cs:line 54 at Fushigi.course.CourseArea..ctor(String areaName) in C:\Users\jacob\Downloads\Fushigi-Bfres-Tile-Rendering\Fushigi-Bfres-Tile-Rendering\Fushigi\course\CourseArea.cs:line 20 at Fushigi.course.Course.LoadFromRomFS() in C:\Users\jacob\Downloads\Fushigi-Bfres-Tile-Rendering\Fushigi-Bfres-Tile-Rendering\Fushigi\course\Course.cs:line 55 at Fushigi.course.Course..ctor(String courseName) in C:\Users\jacob\Downloads\Fushigi-Bfres-Tile-Rendering\Fushigi-Bfres-Tile-Rendering\Fushigi\course\Course.cs:line 24 at Fushigi.ui.MainWindow.LoadFromSettings(GL gl) in C:\Users\jacob\Downloads\Fushigi-Bfres-Tile-Rendering\Fushigi-Bfres-Tile-Rendering\Fushigi\ui\MainWindow.cs:line 134 at Fushigi.ui.MainWindow.Render(GL gl, Double delta, ImGuiController controller) in C:\Users\jacob\Downloads\Fushigi-Bfres-Tile-Rendering\Fushigi-Bfres-Tile-Rendering\Fushigi\ui\MainWindow.cs:line 311 at Fushigi.windowing.WindowManager.<>c__DisplayClass10_0.<RegisterRenderDelegate>b__1(Double deltaSeconds) in C:\Users\jacob\Downloads\Fushigi-Bfres-Tile-Rendering\Fushigi-Bfres-Tile-Rendering\Fushigi\windowing\WindowManager.cs:line 83 at Silk.NET.Windowing.Internals.ViewImplementationBase.DoRender() 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 Fushigi.ui.MainWindow..ctor() in C:\Users\jacob\Downloads\Fushigi-Bfres-Tile-Rendering\Fushigi-Bfres-Tile-Rendering\Fushigi\ui\MainWindow.cs:line 80 at Program.<Main>$(String[] args) in C:\Users\jacob\Downloads\Fushigi-Bfres-Tile-Rendering\Fushigi-Bfres-Tile-Rendering\Fushigi\Program.cs:line 40

jacobamobin avatar Nov 26 '23 21:11 jacobamobin