mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- added a virtual PostSpawn method to RandomSpawner, this will get called when the actor has been spawned so that the spawner can do some special setup with it.
This commit is contained in:
parent
06c97d898b
commit
3f94a15cfe
2 changed files with 10 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
|||
#include "doomstat.h"
|
||||
#include "doomdata.h"
|
||||
#include "g_levellocals.h"
|
||||
#include "virtual.h"
|
||||
|
||||
#define MAX_RANDOMSPAWNERS_RECURSION 32 // Should be largely more than enough, honestly.
|
||||
static FRandom pr_randomspawn("RandomSpawn");
|
||||
|
@ -211,6 +212,12 @@ class ARandomSpawner : public AActor
|
|||
AActor *rep = GetDefaultByType(GetClass()->GetReplacee());
|
||||
if (rep && ((rep->flags4 & MF4_BOSSDEATH) || (rep->flags2 & MF2_BOSS)))
|
||||
boss = true;
|
||||
|
||||
IFVIRTUAL(ARandomSpawner, PostSpawn)
|
||||
{
|
||||
VMValue params[2] = { (DObject*)this, newmobj };
|
||||
GlobalVMStack.Call(func, params, 2, nullptr, 0, nullptr);
|
||||
}
|
||||
}
|
||||
if (boss)
|
||||
this->tracer = newmobj;
|
||||
|
|
|
@ -189,6 +189,9 @@ class RandomSpawner : Actor native
|
|||
+NOGRAVITY
|
||||
+THRUACTORS
|
||||
}
|
||||
|
||||
virtual void PostSpawn(Actor spawned)
|
||||
{}
|
||||
}
|
||||
|
||||
// Sector flag setter ------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue