mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-29 07:22:07 +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 "doomstat.h"
|
||||||
#include "doomdata.h"
|
#include "doomdata.h"
|
||||||
#include "g_levellocals.h"
|
#include "g_levellocals.h"
|
||||||
|
#include "virtual.h"
|
||||||
|
|
||||||
#define MAX_RANDOMSPAWNERS_RECURSION 32 // Should be largely more than enough, honestly.
|
#define MAX_RANDOMSPAWNERS_RECURSION 32 // Should be largely more than enough, honestly.
|
||||||
static FRandom pr_randomspawn("RandomSpawn");
|
static FRandom pr_randomspawn("RandomSpawn");
|
||||||
|
@ -211,6 +212,12 @@ class ARandomSpawner : public AActor
|
||||||
AActor *rep = GetDefaultByType(GetClass()->GetReplacee());
|
AActor *rep = GetDefaultByType(GetClass()->GetReplacee());
|
||||||
if (rep && ((rep->flags4 & MF4_BOSSDEATH) || (rep->flags2 & MF2_BOSS)))
|
if (rep && ((rep->flags4 & MF4_BOSSDEATH) || (rep->flags2 & MF2_BOSS)))
|
||||||
boss = true;
|
boss = true;
|
||||||
|
|
||||||
|
IFVIRTUAL(ARandomSpawner, PostSpawn)
|
||||||
|
{
|
||||||
|
VMValue params[2] = { (DObject*)this, newmobj };
|
||||||
|
GlobalVMStack.Call(func, params, 2, nullptr, 0, nullptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (boss)
|
if (boss)
|
||||||
this->tracer = newmobj;
|
this->tracer = newmobj;
|
||||||
|
|
|
@ -189,6 +189,9 @@ class RandomSpawner : Actor native
|
||||||
+NOGRAVITY
|
+NOGRAVITY
|
||||||
+THRUACTORS
|
+THRUACTORS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void PostSpawn(Actor spawned)
|
||||||
|
{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sector flag setter ------------------------------------------------------
|
// Sector flag setter ------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue