From 7bec171f4c310fddd178d7e05fba7fcb7fe88131 Mon Sep 17 00:00:00 2001 From: TimePath Date: Thu, 31 Aug 2017 20:37:27 +1000 Subject: [PATCH] spawnfuncs: fix alternate worldspawn classnames --- qcsrc/lib/_all.inc | 2 +- qcsrc/lib/spawnfunc.qh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/qcsrc/lib/_all.inc b/qcsrc/lib/_all.inc index 6e93c5af3..9d5820910 100644 --- a/qcsrc/lib/_all.inc +++ b/qcsrc/lib/_all.inc @@ -188,7 +188,7 @@ void make_safe_for_remove(entity this); if (!_StartFrame_init) { _StartFrame_init = true; float oldtime = time; time = 1; - __spawnfunc_expecting = 2; spawnfunc_worldspawn(NULL); + __spawnfunc_expecting = 2; NULL.__spawnfunc_constructor(NULL); time = oldtime; } if (_StartFrame) _StartFrame(); diff --git a/qcsrc/lib/spawnfunc.qh b/qcsrc/lib/spawnfunc.qh index 98922d487..3434d3998 100644 --- a/qcsrc/lib/spawnfunc.qh +++ b/qcsrc/lib/spawnfunc.qh @@ -99,6 +99,9 @@ noref bool require_spawnfunc_prefix; if (this) { \ /* not worldspawn, delay spawn */ \ __spawnfunc_defer(this, __spawnfunc_##id); \ + } else { \ + /* world might not be "worldspawn" */ \ + this.__spawnfunc_constructor = __spawnfunc_##id; \ } \ } \ if (dospawn) { __spawnfunc_##id(this); } \ -- 2.39.2