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

Runtime error downcasts in editor #5703

Open
Robyt3 opened this issue Aug 5, 2022 · 2 comments
Open

Runtime error downcasts in editor #5703

Robyt3 opened this issue Aug 5, 2022 · 2 comments
Labels
bug An unintended feature or error in the code. editor Related to the map editor.

Comments

@Robyt3
Copy link
Member

Robyt3 commented Aug 5, 2022

  1. Open or create a map with Game, Tele, Speedup, Switch and Tune layers.
  2. Select a brush in the Game layer.
  3. Switch to the Tele, Speedup, Switch or Tune layer and shift click to paste the brush. This causes the following downcast runtime errors respectively:
src/game/editor/layer_tiles.cpp:1231:52: runtime error: downcast of address 0x616000031e80 which does not point to an object of type 'CLayerTele'
0x616000031e80: note: object is of type 'CLayerTiles'
 17 00 00 10  b0 d8 4c 77 1f 56 00 00  00 01 00 00 20 62 00 00  00 69 6e 76 61 6c 69 64  29 00 be be
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'CLayerTiles'
    0 0x561f76a3e198 in CLayerTele::FillSelection(bool, CLayer*, CUIRect) src/game/editor/layer_tiles.cpp:1231
    1 0x561f7684b6e9 in CEditor::DoMapEditor(CUIRect) src/game/editor/editor.cpp:2641
    2 0x561f768d9755 in CEditor::Render() src/game/editor/editor.cpp:5747
    3 0x561f76904a56 in CEditor::OnRender() src/game/editor/editor.cpp:6437
    4 0x561f75b7002d in CClient::Run() src/engine/client/client.cpp:3374
    5 0x561f75bdbf7b in main src/engine/client/client.cpp:4762

src/game/editor/layer_tiles.cpp:1477:58: runtime error: downcast of address 0x616000031e80 which does not point to an object of type 'CLayerSpeedup'
0x616000031e80: note: object is of type 'CLayerTiles'
 17 00 00 10  b0 d8 4c 77 1f 56 00 00  00 01 00 00 20 62 00 00  00 69 6e 76 61 6c 69 64  29 00 be be
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'CLayerTiles'
    0 0x561f76a57cde in CLayerSpeedup::FillSelection(bool, CLayer*, CUIRect) src/game/editor/layer_tiles.cpp:1477
    1 0x561f7684b6e9 in CEditor::DoMapEditor(CUIRect) src/game/editor/editor.cpp:2641
    2 0x561f768d9755 in CEditor::Render() src/game/editor/editor.cpp:5747
    3 0x561f76904a56 in CEditor::OnRender() src/game/editor/editor.cpp:6437
    4 0x561f75b7002d in CClient::Run() src/engine/client/client.cpp:3374
    5 0x561f75bdbf7b in main src/engine/client/client.cpp:4762

src/game/editor/layer_tiles.cpp:1765:56: runtime error: downcast of address 0x616000031e80 which does not point to an object of type 'CLayerSwitch'
0x616000031e80: note: object is of type 'CLayerTiles'
 17 00 00 10  b0 d8 4c 77 1f 56 00 00  00 01 00 00 20 62 00 00  00 69 6e 76 61 6c 69 64  29 00 be be
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'CLayerTiles'
    0 0x561f76a76012 in CLayerSwitch::FillSelection(bool, CLayer*, CUIRect) src/game/editor/layer_tiles.cpp:1765
    1 0x561f7684b6e9 in CEditor::DoMapEditor(CUIRect) src/game/editor/editor.cpp:2641
    2 0x561f768d9755 in CEditor::Render() src/game/editor/editor.cpp:5747
    3 0x561f76904a56 in CEditor::OnRender() src/game/editor/editor.cpp:6437
    4 0x561f75b7002d in CClient::Run() src/engine/client/client.cpp:3374
    5 0x561f75bdbf7b in main src/engine/client/client.cpp:4762

src/game/editor/layer_tiles.cpp:2002:52: runtime error: downcast of address 0x616000031e80 which does not point to an object of type 'CLayerTune'
0x616000031e80: note: object is of type 'CLayerTiles'
 17 00 00 10  b0 d8 4c 77 1f 56 00 00  00 01 00 00 20 62 00 00  00 69 6e 76 61 6c 69 64  29 00 be be
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'CLayerTiles'
    0 0x561f76a8c7bd in CLayerTune::FillSelection(bool, CLayer*, CUIRect) src/game/editor/layer_tiles.cpp:2002
    1 0x561f7684b6e9 in CEditor::DoMapEditor(CUIRect) src/game/editor/editor.cpp:2641
    2 0x561f768d9755 in CEditor::Render() src/game/editor/editor.cpp:5747
    3 0x561f76904a56 in CEditor::OnRender() src/game/editor/editor.cpp:6437
    4 0x561f75b7002d in CClient::Run() src/engine/client/client.cpp:3374
    5 0x561f75bdbf7b in main src/engine/client/client.cpp:4762
@Robyt3 Robyt3 added bug An unintended feature or error in the code. editor Related to the map editor. labels Aug 5, 2022
@MilkeeyCat
Copy link
Contributor

Can't reproduce

@Robyt3
Copy link
Member Author

Robyt3 commented Jan 6, 2025

I can still reproduce it. It only happens with the shift+click brush action not when drawing with a brush normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unintended feature or error in the code. editor Related to the map editor.
Projects
None yet
Development

No branches or pull requests

2 participants