From: Mario Date: Sun, 21 Aug 2016 11:12:56 +0000 (+1000) Subject: More intrusiveness X-Git-Tag: xonotic-v0.8.2~663^2~29 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c51788ec53d7f106eeb712416df3ff2bdf85c1c0;p=xonotic%2Fxonotic-data.pk3dir.git More intrusiveness --- diff --git a/qcsrc/common/triggers/func/breakable.qc b/qcsrc/common/triggers/func/breakable.qc index 2b7a1155f..b922a65b6 100644 --- a/qcsrc/common/triggers/func/breakable.qc +++ b/qcsrc/common/triggers/func/breakable.qc @@ -351,7 +351,7 @@ spawnfunc(func_breakable) this.reset = func_breakable_reset; this.reset(this); - this.init_for_player_needed = 1; + IL_PUSH(g_initforplayer, this); this.init_for_player = func_breakable_init_for_player; CSQCMODEL_AUTOINIT(this); diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/default/bot.qc index 502e2532c..ca12d0d65 100644 --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@ -436,7 +436,7 @@ void bot_removefromlargestteam() int bestcount = 0; int bcount = 0; - FOREACH_ENTITY_FLOAT(isbot, true, + FOREACH_CLIENT(it.isbot, { ++bcount; @@ -486,7 +486,7 @@ void bot_removenewest() entity best = NULL; int bcount = 0; - FOREACH_ENTITY_FLOAT(isbot, true, + FOREACH_CLIENT(it.isbot, { ++bcount; diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 0c6f66a2c..47bbbc545 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -1196,7 +1196,7 @@ void ClientConnect(entity this) if (IS_REAL_CLIENT(this)) sv_notice_join(this); - FOREACH_ENTITY_FLOAT(init_for_player_needed, true, { + IL_EACH(g_initforplayer, it.init_for_player, { it.init_for_player(it, this); }); diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index e2e73c58d..b36906c7f 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -426,7 +426,6 @@ const int MIF_GUIDED_CONFUSABLE = MIF_GUIDED_HEAT | MIF_GUIDED_AI; .string cvar_cl_physics; -.bool init_for_player_needed; .void(entity this, entity player) init_for_player; IntrusiveList g_monsters; @@ -449,3 +448,6 @@ STATIC_INIT(g_projectiles) { g_projectiles = IL_NEW(); } IntrusiveList g_items; STATIC_INIT(g_items) { g_items = IL_NEW(); } + +IntrusiveList g_initforplayer; +STATIC_INIT(g_initforplayer) { g_initforplayer = IL_NEW(); } diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index 1bb6974eb..5dbcc8fd2 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -191,7 +191,7 @@ void StartFrame() } #endif - FOREACH_ENTITY_FLOAT(csqcprojectile_clientanimate, true, CSQCProjectile_Check(it)); + IL_EACH(g_projectiles, it.csqcprojectile_clientanimate, CSQCProjectile_Check(it)); if (RedirectionThink()) return;