mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- fixed: DCorpsePointer's constructor was doing nasty stuff while the object wasn't fully set up yet.
This commit is contained in:
parent
47bcd8aaa2
commit
4f67dc4f01
1 changed files with 8 additions and 3 deletions
|
@ -85,6 +85,7 @@ class DCorpsePointer : public DThinker
|
|||
HAS_OBJECT_POINTERS
|
||||
public:
|
||||
DCorpsePointer (AActor *ptr);
|
||||
void Queue();
|
||||
void OnDestroy() override;
|
||||
void Serialize(FSerializer &arc);
|
||||
TObjPtr<AActor*> Corpse;
|
||||
|
@ -119,7 +120,10 @@ DCorpsePointer::DCorpsePointer (AActor *ptr)
|
|||
: DThinker(STAT_CORPSEPOINTER), Corpse(ptr)
|
||||
{
|
||||
Count = 0;
|
||||
}
|
||||
|
||||
void DCorpsePointer::Queue()
|
||||
{
|
||||
// Thinkers are added to the end of their respective lists, so
|
||||
// the first thinker in the list is the oldest one.
|
||||
TThinkerIterator<DCorpsePointer> iterator (STAT_CORPSEPOINTER);
|
||||
|
@ -184,7 +188,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_QueueCorpse)
|
|||
|
||||
if (sv_corpsequeuesize > 0)
|
||||
{
|
||||
Create<DCorpsePointer> (self);
|
||||
auto p = Create<DCorpsePointer> (self);
|
||||
p->Queue();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue