]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/pinata/sv_pinata.qc
Merge branch 'master' into Mario/target_teleporter_v2
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / pinata / sv_pinata.qc
index bc3887e860f8dd50a76f2ea5a4f61fd866020046..53e4f49e60aadf08b13f9eb0880d3fe18711acd1 100644 (file)
@@ -6,12 +6,20 @@ MUTATOR_HOOKFUNCTION(pinata, PlayerDies)
 {
        entity frag_target = M_ARGV(2, entity);
 
-       FOREACH(Weapons, it != WEP_Null, LAMBDA(
-               if(frag_target.weapons & WepSet_FromWeapon(it))
-               if(PS(frag_target).m_switchweapon != it)
-               if(W_IsWeaponThrowable(frag_target, it.m_id))
-                       W_ThrowNewWeapon(frag_target, it.m_id, false, CENTER_OR_VIEWOFS(frag_target), randomvec() * 175 + '0 0 325');
-       ));
+       for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
+       {
+               .entity weaponentity = weaponentities[slot];
+
+               if(frag_target.(weaponentity).m_weapon == WEP_Null)
+                       continue;
+
+               FOREACH(Weapons, it != WEP_Null, {
+                       if(frag_target.weapons & WepSet_FromWeapon(it))
+                       if(frag_target.(weaponentity).m_weapon != it)
+                       if(W_IsWeaponThrowable(frag_target, it.m_id))
+                               W_ThrowNewWeapon(frag_target, it.m_id, false, CENTER_OR_VIEWOFS(frag_target), randomvec() * 175 + '0 0 325', weaponentity);
+               });
+       }
 
        return true;
 }