mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 15:22:08 +00:00
fixed actor class creation for DSDHacked
* the did not get defaults assigned. * the RETARGETAFTERSLAM flag must also be set for newly created classes here
This commit is contained in:
parent
79831526cd
commit
22e8bea91b
1 changed files with 5 additions and 5 deletions
|
@ -134,15 +134,15 @@ static PClassActor* FindInfoName(int index, bool mustexist = false)
|
||||||
{
|
{
|
||||||
FStringf name("~Dsdhacked~%d", index);
|
FStringf name("~Dsdhacked~%d", index);
|
||||||
auto cls = PClass::FindActor(name);
|
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)
|
if (!mustexist)
|
||||||
{
|
{
|
||||||
cls = static_cast<PClassActor*>(RUNTIME_CLASS(AActor)->CreateDerivedClass(name.GetChars(), (unsigned)sizeof(AActor)));
|
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.
|
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;
|
return cls;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue