I have a behavior tree which has a bunch of selector and sequence nodes. The behavior tree has a blackboard which contains an enum for creature “state” information. Based off of the creature state, the behavior tree does different things.
Well, I later found that I didn’t need half of the states I had listed in my enum variable anymore, so I deleted them. The behavior tree wasn’t using them directly in any of its nodes, so no big deal, right? Wrong.
I can open the blackboard with no issues. I can view the enum object with no issues. However, opening the behavior tree causes a hang and crash. When the behavior tree tries to iterate over each enum, the enum object still contains the old index ID’s of each item. So, the integer sequence is:
[0] 0x000000001769aa80 “EZombieState::NewEnumerator1”
[1] 0x000000001769aae0 “EZombieState::NewEnumerator6”
[2] 0x000000001769ab10 “EZombieState::NewEnumerator7”
[3] 0x000000001769ab40 “EZombieState::NewEnumerator9”
[4] 0x000000001769aab0 “EZombieState::NewEnumerator10”
[5] 0x000000001769aa50 “EZombieState::EZombieState_MAX”
Crashes on: C:\Users\Eric\Documents\Visual 2013\Projects\UnrealEngine-4.7\Engine\Source\Runtime\CoreUObject\Private\UObject\Enum.cpp
Line: 353
bool UEnum::HasMetaData( const TCHAR* Key, int32 NameIndex/=INDEX_NONE/ ) const
NameIndex value is 8, but if you look at the enumerators posted above, 8 doesn’t exist.
Crashes on Line 368 because the NameIndex isn’t a valid entry in the enum.