Skip to content

CustomProperty LinkedItem breaks after re-loading a level #34

Description

@AlexDiede

Steps to recreate issue:
0) Create a level with two rectangle shapes in them (just use default names)

  1. Add a custom property to 'Rectangle_1' of type 'Linked item' with any name
  2. Choose 'Rectangle_2' for the value of the custom property you just created
  3. Save the level
  4. Restart Gleed2D
  5. Load the level you just saved
  6. Click on 'Rectangle_1'
  7. Click on the dropdown box for the custom property (as if you were going to edit the value)
  8. An error will pop up saying, "Unable to cast object of type 'System.String' to type 'Gleed2D.InGame.LinkedItem'."

If you save the level after doing these steps the custom property's value will be changed from 'Rectangle_2' to '$null$'.

I dug around in the code and tracked the cast that fails to line 24 of LinkedItemUiTypeEditor.cs in Gleed2D.Core.CustomUITypeEditors.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions