From: TimePath Date: Thu, 31 Aug 2017 10:37:27 +0000 (+1000) Subject: spawnfuncs: fix alternate worldspawn classnames X-Git-Tag: xonotic-v0.8.5~2487^2~3 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=7bec171f4c310fddd178d7e05fba7fcb7fe88131;p=xonotic%2Fxonotic-data.pk3dir.git spawnfuncs: fix alternate worldspawn classnames --- 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); } \