Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLR/System.InvalidCastException After placing any rails #78

Open
jacobamobin opened this issue Nov 26, 2023 · 0 comments
Open

CLR/System.InvalidCastException After placing any rails #78

jacobamobin opened this issue Nov 26, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@jacobamobin
Copy link

jacobamobin commented Nov 26, 2023

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.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.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.

$(String[] args) in C:\Users\jacob\Downloads\Fushigi-Bfres-Tile-Rendering\Fushigi-Bfres-Tile-Rendering\Fushigi\Program.cs:line 40

@jacobamobin jacobamobin added the bug Something isn't working label Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant