entityDef: Fix 'spawnclass' not working when referencing other entitydefs
This commit is contained in:
parent
49d44bb21f
commit
40c4d95a2b
|
@ -179,7 +179,18 @@ EntityDef_PrepareEntity(entity target, int id)
|
|||
int spawnWords = 0i;
|
||||
NSEntity targetEnt = (NSEntity)target;
|
||||
entity oldSelf = self;
|
||||
bool isEntDefBased = false;
|
||||
|
||||
/* check if the spawnclass is an entityDef */
|
||||
for (int i = 0i; i < g_entDefCount; i++) {
|
||||
if (g_entDefTable[id].spawnClass == g_entDefTable[i].entClass) {
|
||||
EntityDef_PrepareEntity(self, i);
|
||||
isEntDefBased = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isEntDefBased == false) {
|
||||
/* first we spawn it as the base spawnclass */
|
||||
if (!isfunction(g_entDefTable[id].spawnClass)) {
|
||||
spawnClass = strcat("spawnfunc_", g_entDefTable[id].spawnClass);
|
||||
|
@ -202,6 +213,7 @@ EntityDef_PrepareEntity(entity target, int id)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* now we load the field overrides from the entDef */
|
||||
spawnWords = tokenize_console(g_entDefTable[id].spawnData);
|
||||
|
|
Loading…
Reference in New Issue