tyoeer / Chaoshead

A level editor, scripting interface, campaign editor, and reverse engineering tool for Levelhead
Apache License 2.0
4 stars 1 forks source link

Crash from doing... Well, I don't really know. #3

Closed slothybutt closed 2 years ago

slothybutt commented 2 years ago

I clicked on the "run script" button and it crashed. It worked fine after I rebooted it.

Error

levelEditor/hexInspector.lua:40: bad argument #1 to 'sub' (number expected, got nil)

Traceback

[C]: in function 'sub'
levelEditor/hexInspector.lua:40: in function 'sectionRows'
levelEditor/hexInspector.lua:83: in function 'onReload'
ui/tools/details.lua:34: in function 'reload'
levelEditor/levelRoot.lua:65: in function 'reload'
levelEditor/levelRoot.lua:110: in function 'runScript'
levelEditor/scriptInterface.lua:48: in function 'onClick'
ui/widgets/button.lua:106: in function 'onInputDeactivated'
ui/base/container.lua:133: in function 'inputDeactivated'
...
ui/base/container.lua:126: in function 'inputDeactivated'
ui/base/container.lua:126: in function 'inputDeactivated'
main.lua:37: in function 'inputDeactivated'
libs/tyoeerUtils/input.lua:279: in function 'actionDeactivated'
libs/tyoeerUtils/input.lua:296: in function 'triggerDeactivation'
libs/tyoeerUtils/input.lua:211: in function 'mousereleased'
main.lua:54: in function <main.lua:53>
[C]: in function 'xpcall'
tyoeer commented 2 years ago

Steps to reproduce: save a level, then run a script on it. Saving a level removes the information of which section are where in the file (because it is no longer valid). After running a script, the whole editor gets reloaded to mirror any changes made, at which point the Hex Inspector tries to use that information, and fails so miserably it crashes.

Should be fixed in the next release.