diff --git a/src/farchive.cpp b/src/farchive.cpp index 4a1936f38..6759b40de 100644 --- a/src/farchive.cpp +++ b/src/farchive.cpp @@ -1024,13 +1024,28 @@ FArchive &FArchive::SerializePointer (void *ptrbase, BYTE **ptr, DWORD elemSize) FArchive &FArchive::SerializeObject (DObject *&object, PClass *type) { - if (IsStoring ()) - { - return WriteObject (object); + if (!type->IsDescendantOf(RUNTIME_CLASS(PClass))) + { // a regular object + if (IsStoring()) + { + return WriteObject(object); + } + else + { + return ReadObject(object, type); + } } else - { - return ReadObject (object, type); + { // a class object + if (IsStoring()) + { + UserWriteClass((PClass *)object); + } + else + { + UserReadClass(object); + } + return *this; } } @@ -1493,19 +1508,6 @@ void FArchive::UserReadClass (PClass *&type) } } -FArchive &operator<< (FArchive &arc, PClass *&info) -{ - if (arc.IsStoring ()) - { - arc.UserWriteClass (info); - } - else - { - arc.UserReadClass (info); - } - return arc; -} - FArchive &operator<< (FArchive &arc, sector_t *&sec) { return arc.SerializePointer (sectors, (BYTE **)&sec, sizeof(*sectors)); diff --git a/src/farchive.h b/src/farchive.h index 1a6f98ec5..7b9327d59 100644 --- a/src/farchive.h +++ b/src/farchive.h @@ -275,8 +275,6 @@ inline FArchive &operator<< (FArchive &arc, T* &object) return arc.SerializeObject ((DObject*&)object, RUNTIME_TEMPLATE_CLASS(T)); } -FArchive &operator<< (FArchive &arc, PClass * &info); - class FFont; FArchive &SerializeFFontPtr (FArchive &arc, FFont* &font); template<> inline FArchive &operator<< (FArchive &arc, FFont* &font) diff --git a/src/p_user.cpp b/src/p_user.cpp index c86cf186d..27ecfe60e 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -137,7 +137,7 @@ void SetupPlayerClasses () PlayerClasses.Clear(); for (unsigned i = 0; i < gameinfo.PlayerClasses.Size(); i++) { - PClassActor *cls = PClass::FindActor(gameinfo.PlayerClasses[i]);; + PClassActor *cls = PClass::FindActor(gameinfo.PlayerClasses[i]); if (ValidatePlayerClass(cls, gameinfo.PlayerClasses[i])) { newclass.Flags = 0;