Skip to content

Commit

Permalink
fixed actor class creation for DSDHacked
Browse files Browse the repository at this point in the history
* the did not get defaults assigned.
* the RETARGETAFTERSLAM flag must also be set for newly created classes here
  • Loading branch information
prof-hastig authored and coelckers committed Sep 25, 2023
1 parent 7983152 commit 22e8bea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/gamedata/d_dehacked.cpp
Expand Up @@ -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<PClassActor*>(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;
}
}
Expand Down

0 comments on commit 22e8bea

Please sign in to comment.