Skip to content

Commit

Permalink
Expose OF_Transient to actors as bNoSaveGame
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoLuis0 authored and coelckers committed Sep 14, 2023
1 parent 9f24d8b commit e61ab4c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/common/engine/serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
4 changes: 4 additions & 0 deletions src/common/objects/dobjtype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/scripting/thingdef_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e61ab4c

Please sign in to comment.