#define SPAWNFUNC_INTERNAL_FIELDS(X) \
X(string, classname, "spawnfunc") \
+ X(string, target, string_null) \
+ X(string, target2, string_null) \
+ X(string, target3, string_null) \
+ X(string, target4, string_null) \
X(string, targetname, string_null) \
/**/
g_map_entities = IL_NEW(); \
IL_EACH(g_spawn_queue, true, __spawnfunc_spawn(it)); \
MACRO_END
-
+#ifdef SVQC
+ void _SV_OnEntityPreSpawnFunction(entity this);
+#endif
void __spawnfunc_spawn(entity prototype)
{
entity e = new(clone);
#define X(T, fld, def) { e.fld = e.__spawnfunc_##fld; e.__spawnfunc_##fld = def; }
SPAWNFUNC_INTERNAL_FIELDS(X);
#undef X
+#ifdef SVQC
+ _SV_OnEntityPreSpawnFunction(e);
+ if (wasfreed(e)) {
+ return;
+ }
+#endif
e.__spawnfunc_constructor(e);
}