From 7524bb96d7c477621052de0d10a12571b7e53451 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 24 Dec 2015 09:43:26 +1000 Subject: [PATCH] New loop for new toys --- qcsrc/common/mutators/mutator/new_toys/new_toys.qc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 -- 2.39.2