From: Mario Date: Wed, 23 Dec 2015 23:43:26 +0000 (+1000) Subject: New loop for new toys X-Git-Tag: xonotic-v0.8.2~1446 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7524bb96d7c477621052de0d10a12571b7e53451;p=xonotic%2Fxonotic-data.pk3dir.git New loop for new toys --- diff --git a/qcsrc/common/mutators/mutator/new_toys/new_toys.qc b/qcsrc/common/mutators/mutator/new_toys/new_toys.qc index 20a9d94f5..2f4510a3f 100644 --- a/qcsrc/common/mutators/mutator/new_toys/new_toys.qc +++ b/qcsrc/common/mutators/mutator/new_toys/new_toys.qc @@ -77,16 +77,18 @@ REGISTER_MUTATOR(nt, cvar("g_new_toys") && !cvar("g_instagib") && !cvar("g_overk error("This cannot be added at runtime\n"); // mark the guns as ok to use by e.g. impulse 99 - for(int i = WEP_FIRST; i <= WEP_LAST; ++i) - if(nt_IsNewToy(i)) - Weapons_from(i).spawnflags &= ~WEP_FLAG_MUTATORBLOCKED; + FOREACH(Weapons, it != WEP_Null, LAMBDA( + if(nt_IsNewToy(it.m_id)) + it.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED; + )); } MUTATOR_ONROLLBACK_OR_REMOVE { - for(int i = WEP_FIRST; i <= WEP_LAST; ++i) - if(nt_IsNewToy(i)) - Weapons_from(i).spawnflags |= WEP_FLAG_MUTATORBLOCKED; + FOREACH(Weapons, it != WEP_Null, LAMBDA( + if(nt_IsNewToy(it.m_id)) + it.spawnflags |= WEP_FLAG_MUTATORBLOCKED; + )); } MUTATOR_ONREMOVE