entityDef: call spawn() in case an empty entity ref was passed
This commit is contained in:
parent
66745985d4
commit
3eb2ec1b37
1 changed files with 4 additions and 0 deletions
|
@ -181,6 +181,10 @@ EntityDef_PrepareEntity(entity target, int id)
|
||||||
entity oldSelf = self;
|
entity oldSelf = self;
|
||||||
bool isEntDefBased = false;
|
bool isEntDefBased = false;
|
||||||
|
|
||||||
|
if (!targetEnt) {
|
||||||
|
targetEnt = spawn(NSEntity);
|
||||||
|
}
|
||||||
|
|
||||||
/* check if the spawnclass is an entityDef */
|
/* check if the spawnclass is an entityDef */
|
||||||
for (int i = 0i; i < g_entDefCount; i++) {
|
for (int i = 0i; i < g_entDefCount; i++) {
|
||||||
if (g_entDefTable[id].spawnClass == g_entDefTable[i].entClass) {
|
if (g_entDefTable[id].spawnClass == g_entDefTable[i].entClass) {
|
||||||
|
|
Loading…
Reference in a new issue