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

Lists of GameResources inside a GameResource gets casted to the base type even for extended/derived types #6630

Open
MrBrax opened this issue Oct 17, 2024 · 1 comment
Labels

Comments

@MrBrax
Copy link

MrBrax commented Oct 17, 2024

Describe the bug

I have a base ItemData class and a ToolData class which is derived from ItemData. Making a List<ItemData> in a GameResource for list keeping, when accessing that list later in code all of the items are cast to ItemData, completely breaking the data.

To Reproduce

  1. Make a base GameResource
  2. Make a derived GameResource of the base
  3. Make a list GameResource
  4. Populate the list with both base and derived items
  5. When trying to access the list, most likely after a restart, all items will be cast to the base.

Expected behavior

All gameresources should retain their original type

Media/Files

No response

Additional context

No response

@MrBrax
Copy link
Author

MrBrax commented Oct 17, 2024

list_derived_repro.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: To triage
Development

No branches or pull requests

2 participants