mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- fixed: PPointer was unable to handle pointers to class types for savegames.
This commit is contained in:
parent
7c3c886a90
commit
b31b6589e7
1 changed files with 12 additions and 2 deletions
|
@ -1652,7 +1652,11 @@ void PPointer::SetPointer(void *base, unsigned offset, TArray<size_t> *special)
|
||||||
|
|
||||||
void PPointer::WriteValue(FSerializer &ar, const char *key,const void *addr) const
|
void PPointer::WriteValue(FSerializer &ar, const char *key,const void *addr) const
|
||||||
{
|
{
|
||||||
if (PointedType->IsKindOf(RUNTIME_CLASS(PClass)))
|
if (PointedType->IsKindOf(RUNTIME_CLASS(PClassClass)))
|
||||||
|
{
|
||||||
|
ar(key, *(PClass **)addr);
|
||||||
|
}
|
||||||
|
else if (PointedType->IsKindOf(RUNTIME_CLASS(PClass)))
|
||||||
{
|
{
|
||||||
ar(key, *(DObject **)addr);
|
ar(key, *(DObject **)addr);
|
||||||
}
|
}
|
||||||
|
@ -1671,7 +1675,13 @@ void PPointer::WriteValue(FSerializer &ar, const char *key,const void *addr) con
|
||||||
|
|
||||||
bool PPointer::ReadValue(FSerializer &ar, const char *key, void *addr) const
|
bool PPointer::ReadValue(FSerializer &ar, const char *key, void *addr) const
|
||||||
{
|
{
|
||||||
if (PointedType->IsKindOf(RUNTIME_CLASS(PClass)))
|
if (PointedType->IsKindOf(RUNTIME_CLASS(PClassClass)))
|
||||||
|
{
|
||||||
|
bool res = false;
|
||||||
|
::Serialize(ar, key, *(PClass **)addr, (PClass**)nullptr);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
else if (PointedType->IsKindOf(RUNTIME_CLASS(PClass)))
|
||||||
{
|
{
|
||||||
bool res = false;
|
bool res = false;
|
||||||
::Serialize(ar, key, *(DObject **)addr, nullptr, &res);
|
::Serialize(ar, key, *(DObject **)addr, nullptr, &res);
|
||||||
|
|
Loading…
Reference in a new issue