mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 20:43:15 +00:00
- fixed: Meta properties must not be serialized.
This commit is contained in:
parent
0583691670
commit
b5d4a59465
1 changed files with 7 additions and 2 deletions
|
@ -2307,7 +2307,7 @@ void PStruct::WriteFields(FSerializer &ar, const void *addr, const TArray<PField
|
|||
{
|
||||
const PField *field = fields[i];
|
||||
// Skip fields without or with native serialization
|
||||
if (!(field->Flags & VARF_Transient))
|
||||
if (!(field->Flags & (VARF_Transient|VARF_Meta)))
|
||||
{
|
||||
field->Type->WriteValue(ar, field->SymbolName.GetChars(), (const BYTE *)addr + field->Offset);
|
||||
}
|
||||
|
@ -2340,6 +2340,11 @@ bool PStruct::ReadFields(FSerializer &ar, void *addr) const
|
|||
DPrintf(DMSG_ERROR, "Symbol %s in %s is not a field\n",
|
||||
label, TypeName.GetChars());
|
||||
}
|
||||
else if ((static_cast<const PField *>(sym)->Flags & (VARF_Transient | VARF_Meta)))
|
||||
{
|
||||
DPrintf(DMSG_ERROR, "Symbol %s in %s is not a serializable field\n",
|
||||
label, TypeName.GetChars());
|
||||
}
|
||||
else
|
||||
{
|
||||
readsomething |= static_cast<const PField *>(sym)->Type->ReadValue(ar, nullptr,
|
||||
|
@ -2638,7 +2643,7 @@ static void RecurseWriteFields(const PClass *type, FSerializer &ar, const void *
|
|||
// Don't write this part if it has no non-transient variables
|
||||
for (unsigned i = 0; i < type->Fields.Size(); ++i)
|
||||
{
|
||||
if (!(type->Fields[i]->Flags & VARF_Transient))
|
||||
if (!(type->Fields[i]->Flags & (VARF_Transient|VARF_Meta)))
|
||||
{
|
||||
// Tag this section with the class it came from in case
|
||||
// a more-derived class has variables that shadow a less-
|
||||
|
|
Loading…
Reference in a new issue