mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 07:11:54 +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
|
HAS_OBJECT_POINTERS
|
||||||
public:
|
public:
|
||||||
DCorpsePointer (AActor *ptr);
|
DCorpsePointer (AActor *ptr);
|
||||||
|
void Queue();
|
||||||
void OnDestroy() override;
|
void OnDestroy() override;
|
||||||
void Serialize(FSerializer &arc);
|
void Serialize(FSerializer &arc);
|
||||||
TObjPtr<AActor*> Corpse;
|
TObjPtr<AActor*> Corpse;
|
||||||
|
@ -115,11 +116,14 @@ CUSTOM_CVAR(Int, sv_corpsequeuesize, 64, CVAR_ARCHIVE|CVAR_SERVERINFO)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DCorpsePointer::DCorpsePointer (AActor *ptr)
|
DCorpsePointer::DCorpsePointer(AActor *ptr)
|
||||||
: DThinker (STAT_CORPSEPOINTER), Corpse (ptr)
|
: DThinker(STAT_CORPSEPOINTER), Corpse(ptr)
|
||||||
{
|
{
|
||||||
Count = 0;
|
Count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DCorpsePointer::Queue()
|
||||||
|
{
|
||||||
// Thinkers are added to the end of their respective lists, so
|
// Thinkers are added to the end of their respective lists, so
|
||||||
// the first thinker in the list is the oldest one.
|
// the first thinker in the list is the oldest one.
|
||||||
TThinkerIterator<DCorpsePointer> iterator (STAT_CORPSEPOINTER);
|
TThinkerIterator<DCorpsePointer> iterator (STAT_CORPSEPOINTER);
|
||||||
|
@ -184,7 +188,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_QueueCorpse)
|
||||||
|
|
||||||
if (sv_corpsequeuesize > 0)
|
if (sv_corpsequeuesize > 0)
|
||||||
{
|
{
|
||||||
Create<DCorpsePointer> (self);
|
auto p = Create<DCorpsePointer> (self);
|
||||||
|
p->Queue();
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue