mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 15:02:01 +00:00
- serialize 'spawned' object flag, WorldThingDestroyed event relies on it
https://forum.zdoom.org/viewtopic.php?t=60435
This commit is contained in:
parent
f4c49b6cff
commit
437b44bafb
1 changed files with 13 additions and 6 deletions
|
@ -584,13 +584,20 @@ void DObject::SerializeUserVars(FSerializer &arc)
|
|||
|
||||
void DObject::Serialize(FSerializer &arc)
|
||||
{
|
||||
int fresh = ObjectFlags & OF_JustSpawned;
|
||||
int freshdef = 0;
|
||||
arc("justspawned", fresh, freshdef);
|
||||
const auto SerializeFlag = [&](const char *const name, const EObjectFlags flag)
|
||||
{
|
||||
int value = ObjectFlags & flag;
|
||||
int defaultvalue = 0;
|
||||
arc(name, value, defaultvalue);
|
||||
if (arc.isReading())
|
||||
{
|
||||
ObjectFlags |= fresh;
|
||||
ObjectFlags |= value;
|
||||
}
|
||||
};
|
||||
|
||||
SerializeFlag("justspawned", OF_JustSpawned);
|
||||
SerializeFlag("spawned", OF_Spawned);
|
||||
|
||||
ObjectFlags |= OF_SerialSuccess;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue