entityDef: call spawn() in case an empty entity ref was passed

This commit is contained in:
Marco Cawthorne 2023-06-07 16:50:40 -07:00
parent 66745985d4
commit 3eb2ec1b37
Signed by: eukara
GPG key ID: CE2032F0A2882A22

View file

@ -181,6 +181,10 @@ EntityDef_PrepareEntity(entity target, int id)
entity oldSelf = self;
bool isEntDefBased = false;
if (!targetEnt) {
targetEnt = spawn(NSEntity);
}
/* check if the spawnclass is an entityDef */
for (int i = 0i; i < g_entDefCount; i++) {
if (g_entDefTable[id].spawnClass == g_entDefTable[i].entClass) {