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

Crash + Json: Tileset rectangles are able to point to a nonexistent tileset definition #1107

Open
Cammin opened this issue May 12, 2024 · 0 comments

Comments

@Cammin
Copy link

Cammin commented May 12, 2024

  • Crash
    For any instances where TilesetRectangle icon is used (IntGridValueDefinition, EnumValueDefinition, EntityDefinition, FieldInstance AutoLayerRuleGroup), If I delete its tileset definition, but check back on it to readjust, I get a crash, likely due to reading a tileset definition that has become null. (see video)

  • Json
    In addition to the crash, these rectangle objects can have their uid still point to a uid tileset that no longer exists, which can cause unexpected behaviour in an importer. I can safely check if the definition doesn't exist if the uid isn't in its dictionary lookup, but it hasn't been a scenario I've had to account for before. I think the right thing to do in this situation is:
    "When a tileset definition is deleted, for all tileset rectangles that use this tileset def, turn them null"

LDtk_9AFSLJC8XK.mp4

Stack:

LDtk version: 1.5.3-64bits
Cannot read properties of undefined (reading 'embedAtlas')
TypeError
TypeError: Cannot read properties of undefined (reading 'embedAtlas')
    at ui_modal_panel_EditEntityDefs.updateEntityForm (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:303398:10)
    at ui_modal_panel_EditEntityDefs.selectEntity (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:303011:8)
    at new ui_modal_panel_EditEntityDefs (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:302847:9)
    at page_Editor.onAppCommand (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:234605:5)
    at App.executeAppCommand (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:3632:24)
    at HTMLButtonElement.<anonymous> (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:233079:11)
    at HTMLButtonElement.dispatch (C:\Users\cameo\AppData\Local\Programs\ldtk\resources\app.asar\assets\js\jquery.min.js:2:43064)
    at v.handle (C:\Users\cameo\AppData\Local\Programs\ldtk\resources\app.asar\assets\js\jquery.min.js:2:41048)

Processes:

#0 App
 |--- #2 page.Editor
       |--- #3 misc.FileWatcher
       |--- #4 display.WorldRender
       |--- #5 display.LevelRender
       |--- #6 display.Camera
       |--- #7 display.Rulers[--]
       |--- #8 tool.SelectionTool[--]
       |--- #9 tool.lt.DoNothing[--]
       |--- #10 WorldTool
       |--- #11 tool.PanView[--]
       |--- #12 tool.lt.EntityTool[--]
       |--- #102 ui.modal.panel.EditTilesetDefs
       |--- #109 ui.LastChance
       |--- #110 display.EntityRender
       |--- #111 display.EntityRender
       |--- #112 display.EntityRender
       |--- #113 display.EntityRender
       |--- #114 display.EntityRender
       |--- #115 display.EntityRender
       |--- #116 display.EntityRender
       |--- #117 display.EntityRender
       |--- #118 display.EntityRender
       |--- #119 display.EntityRender
       |--- #120 display.EntityRender
       |--- #121 display.EntityRender
       |--- #122 display.EntityRender
       |--- #123 display.EntityRender
       |--- #124 display.EntityRender
       |--- #125 display.EntityRender
       |--- #126 display.EntityRender
       |--- #127 display.EntityRender
       |--- #128 display.EntityRender
       |--- #129 display.EntityRender
       |--- #130 display.EntityRender
       |--- #131 display.EntityRender
       |--- #132 display.EntityRender
       |--- #133 display.EntityRender
       |--- #134 display.EntityRender
       |--- #135 display.EntityRender
       |--- #136 display.EntityRender
       |--- #139 ui.Tip
       |--- #140 ui.modal.panel.EditEntityDefs

Log:

[USERACTION]   Closed panel #87 ui.modal.panel.EditTilesetDefs
[FILE]         Reading HTML template editEntityDefs from cache
[FILE]         Reading HTML template fieldDefsForm from cache
[FILE]         Reading HTML template pivotEditor from cache
[RENDER]       Rendering world bg...
[RENDER]       Rendering world bg...
[RENDER]       Rendering world bg...
[FILE]         Reading HTML template pivotEditor from cache
[FILE]         Reading HTML template pivotEditor from cache
[FILE]         Reading HTML template pivotEditor from cache
[FILE]         Reading HTML template pivotEditor from cache
[FILE]         Reading HTML template pivotEditor from cache
[RENDER]       Rendering world bg...
[RENDER]       Rendering world bg...
[RENDER]       Rendering world bg...
[RENDER]       Rendering world bg...
[RENDER]       Rendering world bg...
[RENDER]       Rendering world bg...
[RENDER]       Rendering world bg...
[USERACTION]   Opened panel #102 ui.modal.panel.EditTilesetDefs
[USERACTION]   Closed panel #92 ui.modal.panel.EditEntityDefs
[FILE]         Reading HTML template editTilesetDefs from cache
[RENDER]       Rendering world bg...
[RENDER]       Rendering world bg...
[RENDER]       Rendering world bg...
[RENDER]       Rendering world bg...
[RENDER]       Rendering world bg...
[RENDER]       Rendering world bg...
[RENDER]       Rendering world bg...
[WARNING]      Last chance for: Tileset SunnyLand_by_Ansimuz_extended deleted
[EVENT]        TilesetDefRemoved 199
[EVENT]        LevelJsonCacheInvalidated
[RENDER]       Rendering world level fields data.Level#f80e4bc0-66b0-11ec-b121-b327a018109c "Entities_demo"...
[WARNING]      Full level render requested
[RENDER]       Rendering world bg...
[RENDER]       Rendering world bg...
[RENDER]       Rendering world bg...
[RENDER]       Rendering world bg...
[USERACTION]   Opened panel #140 ui.modal.panel.EditEntityDefs
[USERACTION]   Closed panel #102 ui.modal.panel.EditTilesetDefs
[FILE]         Reading HTML template editEntityDefs from cache
[FILE]         Reading HTML template fieldDefsForm from cache
[GENERAL]      Page started: page.CrashReport()
[FILE]         Loading page template: crashReport from C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/tpl/pages/crashReport.html
[ERROR]        Cannot read properties of undefined (reading 'embedAtlas') (TypeError)
[ERROR]        TypeError: Cannot read properties of undefined (reading 'embedAtlas')
    at ui_modal_panel_EditEntityDefs.updateEntityForm (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:303398:10)
    at ui_modal_panel_EditEntityDefs.selectEntity (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:303011:8)
    at new ui_modal_panel_EditEntityDefs (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:302847:9)
    at page_Editor.onAppCommand (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:234605:5)
    at App.executeAppCommand (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:3632:24)
    at HTMLButtonElement.<anonymous> (file:///C:/Users/cameo/AppData/Local/Programs/ldtk/resources/app.asar/assets/js/renderer.js:233079:11)
    at HTMLButtonElement.dispatch (C:\Users\cameo\AppData\Local\Programs\ldtk\resources\app.asar\assets\js\jquery.min.js:2:43064)
    at v.handle (C:\Users\cameo\AppData\Local\Programs\ldtk\resources\app.asar\assets\js\jquery.min.js:2:41048)

[GENERAL]      
#0 App
 |--- #2 page.Editor
       |--- #3 misc.FileWatcher
       |--- #4 display.WorldRender
       |--- #5 display.LevelRender
       |--- #6 display.Camera
       |--- #7 display.Rulers[--]
       |--- #8 tool.SelectionTool[--]
       |--- #9 tool.lt.DoNothing[--]
       |--- #10 WorldTool
       |--- #11 tool.PanView[--]
       |--- #12 tool.lt.EntityTool[--]
       |--- #102 ui.modal.panel.EditTilesetDefs
       |--- #109 ui.LastChance
       |--- #110 display.EntityRender
       |--- #111 display.EntityRender
       |--- #112 display.EntityRender
       |--- #113 display.EntityRender
       |--- #114 display.EntityRender
       |--- #115 display.EntityRender
       |--- #116 display.EntityRender
       |--- #117 display.EntityRender
       |--- #118 display.EntityRender
       |--- #119 display.EntityRender
       |--- #120 display.EntityRender
       |--- #121 display.EntityRender
       |--- #122 display.EntityRender
       |--- #123 display.EntityRender
       |--- #124 display.EntityRender
       |--- #125 display.EntityRender
       |--- #126 display.EntityRender
       |--- #127 display.EntityRender
       |--- #128 display.EntityRender
       |--- #129 display.EntityRender
       |--- #130 display.EntityRender
       |--- #131 display.EntityRender
       |--- #132 display.EntityRender
       |--- #133 display.EntityRender
       |--- #134 display.EntityRender
       |--- #135 display.EntityRender
       |--- #136 display.EntityRender
       |--- #139 ui.Tip
       |--- #140 ui.modal.panel.EditEntityDefs
 |--- #141 page.CrashReport

[FILE]         Cleared all file watches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant