diff --git a/src/gamedata/d_dehacked.cpp b/src/gamedata/d_dehacked.cpp index 9eb1438173..6b91694d0b 100644 --- a/src/gamedata/d_dehacked.cpp +++ b/src/gamedata/d_dehacked.cpp @@ -134,15 +134,15 @@ static PClassActor* FindInfoName(int index, bool mustexist = false) { FStringf name("~Dsdhacked~%d", index); auto cls = PClass::FindActor(name); - if (cls) - { - GetDefaultByType(cls)->flags8 |= MF8_RETARGETAFTERSLAM; // This flag is not a ZDoom default, but it must be a Dehacked default. - return cls; - } if (!mustexist) { cls = static_cast(RUNTIME_CLASS(AActor)->CreateDerivedClass(name.GetChars(), (unsigned)sizeof(AActor))); NewClassType(cls, -1); // This needs a VM type to work as intended. + cls->InitializeDefaults(); + } + if (cls) + { + GetDefaultByType(cls)->flags8 |= MF8_RETARGETAFTERSLAM; // This flag is not a ZDoom default, but it must be a Dehacked default. return cls; } }