gzdoom/src/g_inventory/a_weaponpiece.h
Christoph Oelckers 87484950cf - removed an assert from APowerMorph::EndEffect. With some recent changes to DestroyAllInventory it appears that the asserted condition no longer is true at this point when ending a game.
- fixed: When replacing a tentative class, the pointers in the morph objects were not replaced. Instead of adding more ReplaceClassRef methods I chose to integrate this part into the PointerSubstitution mechanism and delete ReplaceClassRef entirely. The code had some oversights anyway that would have caused problems, now that non-actors can be created.
2016-12-01 00:05:23 +01:00

37 lines
955 B
C++

#pragma once
#include "a_pickups.h"
#include "a_weapons.h"
class AWeaponPiece : public AInventory
{
DECLARE_CLASS(AWeaponPiece, AInventory)
HAS_OBJECT_POINTERS
protected:
bool PrivateShouldStay ();
public:
virtual void Serialize(FSerializer &arc) override;
virtual bool TryPickup (AActor *&toucher) override;
virtual bool TryPickupRestricted (AActor *&toucher) override;
virtual bool ShouldStay () override;
virtual FString PickupMessage () override;
virtual void PlayPickupSound (AActor *toucher) override;
int PieceValue;
PClassActor *WeaponClass;
TObjPtr<AWeapon> FullWeapon;
};
// an internal class to hold the information for player class independent weapon piece handling
// [BL] Needs to be available for SBarInfo to check weaponpieces
class AWeaponHolder : public AInventory
{
DECLARE_CLASS(AWeaponHolder, AInventory)
public:
int PieceMask;
PClassActor * PieceWeapon;
virtual void Serialize(FSerializer &arc) override;
};