mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-12-04 01:41:42 +00:00
87484950cf
- 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.
37 lines
955 B
C++
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;
|
|
};
|