mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-16 09:31:14 +00:00
- serialize 'spawned' object flag, WorldThingDestroyed event relies on it
https://forum.zdoom.org/viewtopic.php?t=60435
(cherry picked from commit 437b44bafb
)
This commit is contained in:
parent
af92a66bae
commit
a106594b6b
1 changed files with 13 additions and 6 deletions
|
@ -590,13 +590,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