- a few more

This commit is contained in:
Christoph Oelckers 2016-09-19 13:36:58 +02:00
commit a542e99143
7 changed files with 228 additions and 32 deletions

View file

@ -1,7 +1,7 @@
#include "a_pickups.h"
#include "a_weaponpiece.h"
#include "doomstat.h"
#include "farchive.h"
#include "serializer.h"
IMPLEMENT_CLASS(PClassWeaponPiece)
IMPLEMENT_CLASS (AWeaponHolder)
@ -17,10 +17,11 @@ void PClassWeaponPiece::ReplaceClassRef(PClass *oldclass, PClass *newclass)
}
void AWeaponHolder::Serialize(FArchive &arc)
void AWeaponHolder::Serialize(FSerializer &arc)
{
Super::Serialize(arc);
arc << PieceMask << PieceWeapon;
arc("piecemask", PieceMask)
("pieceweapon", PieceWeapon);
}
@ -29,10 +30,13 @@ IMPLEMENT_POINTY_CLASS (AWeaponPiece)
END_POINTERS
void AWeaponPiece::Serialize(FArchive &arc)
void AWeaponPiece::Serialize(FSerializer &arc)
{
Super::Serialize (arc);
arc << WeaponClass << FullWeapon << PieceValue;
auto def = (AWeaponPiece*)GetDefault();
arc("weaponclass", WeaponClass, def->WeaponClass)
("fullweapon", FullWeapon)
("piecevalue", PieceValue, def->PieceValue);
}
//==========================================================================

View file

@ -15,7 +15,8 @@ class AWeaponPiece : public AInventory
protected:
bool PrivateShouldStay ();
public:
void Serialize(FArchive &arc);
DECLARE_OLD_SERIAL
void Serialize(FSerializer &arc);
bool TryPickup (AActor *&toucher);
bool TryPickupRestricted (AActor *&toucher);
bool ShouldStay ();
@ -23,7 +24,7 @@ public:
virtual void PlayPickupSound (AActor *toucher);
int PieceValue;
PClassWeapon *WeaponClass;
PClassActor *WeaponClass;
TObjPtr<AWeapon> FullWeapon;
};
@ -35,7 +36,8 @@ class AWeaponHolder : public AInventory
public:
int PieceMask;
const PClass * PieceWeapon;
PClassActor * PieceWeapon;
void Serialize(FArchive &arc);
DECLARE_OLD_SERIAL
void Serialize(FSerializer &arc);
};