mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-25 05:21:02 +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);
|
||||
if (arc.isReading())
|
||||
const auto SerializeFlag = [&](const char *const name, const EObjectFlags flag)
|
||||
{
|
||||
ObjectFlags |= fresh;
|
||||
}
|
||||
int value = ObjectFlags & flag;
|
||||
int defaultvalue = 0;
|
||||
arc(name, value, defaultvalue);
|
||||
if (arc.isReading())
|
||||
{
|
||||
ObjectFlags |= value;
|
||||
}
|
||||
};
|
||||
|
||||
SerializeFlag("justspawned", OF_JustSpawned);
|
||||
SerializeFlag("spawned", OF_Spawned);
|
||||
|
||||
ObjectFlags |= OF_SerialSuccess;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue