Expose OF_Transient to actors as bNoSaveGame

This commit is contained in:
Ricardo Luís Vaz Silva 2023-02-13 17:03:43 -03:00 committed by Christoph Oelckers
parent 9f24d8babc
commit e61ab4cbe2
3 changed files with 8 additions and 0 deletions

View file

@ -604,6 +604,8 @@ void FSerializer::WriteObjects()
{
auto obj = w->mDObjects[i];
if(obj->ObjectFlags & OF_Transient) continue;
BeginObject(nullptr);
w->Key("classtype");
w->String(obj->GetClass()->TypeName.GetChars());

View file

@ -440,6 +440,10 @@ DObject *PClass::CreateNew()
I_Error("Attempt to instantiate abstract class %s.", TypeName.GetChars());
}
ConstructNative (mem);
if (Defaults != nullptr)
((DObject *)mem)->ObjectFlags |= ((DObject *)Defaults)->ObjectFlags & OF_Transient;
((DObject *)mem)->SetClass (const_cast<PClass *>(this));
InitializeSpecials(mem, Defaults, &PClass::SpecialInits);
return (DObject *)mem;

View file

@ -396,6 +396,8 @@ static FFlagDef ActorFlagDefs[]=
DEFINE_FLAG2(BOUNCE_NotOnShootables, DONTBOUNCEONSHOOTABLES, AActor, BounceFlags),
DEFINE_FLAG2(BOUNCE_BounceOnUnrips, BOUNCEONUNRIPPABLES, AActor, BounceFlags),
DEFINE_FLAG2(BOUNCE_NotOnSky, DONTBOUNCEONSKY, AActor, BounceFlags),
DEFINE_FLAG2(OF_Transient, NOSAVEGAME, AActor, ObjectFlags),
};
// These won't be accessible through bitfield variables