A problem occured when I wanted to use a map variable that had the same C++ Enum for key and value type, which had default values.
Everything worked until the project was closed and reopened.
While trying to reopen, Unreal Engine crashed.
I figured the problem out after reverting changes from newest revisions on my SVN repository.
So, I tried to reproduce the same crash in new project.
And I succeeded in doing so, although the crash didn’t happen when opening the project.
Instead it crashed when opening an asset (in this case, map level) which used a map variable with C++ enum for key, which had default values.
Steps to reproduce:
- Create New Project
- Create New C++ class
- In header file add new enum class (
UENUM(BlueprintType) enum class ETestEnum : uint8 { A, B, C};
) - Rebuild Project
- Create New Map Level
- Open New Map Level Blueprint
- Create new map variable which has the c++ enum class (
ETestEnum
) for key - Add at least 1 item to default values (this seems to be the crash causer)
- Close The Project
- Reopen The Project
- Try Opening the created Map
- Crash
For now, I use the workaround with enum switch, but as I add more enums, the switch will get bigger.