MUTATOR_HOOKFUNCTION(pinata, PlayerDies)
{SELFPARAM();
- for(int j = WEP_FIRST; j <= WEP_LAST; ++j)
- if(self.weapons & WepSet_FromWeapon(Weapons_from(j)))
- if(PS(self).m_switchweapon.m_id != j)
- if(W_IsWeaponThrowable(j))
- W_ThrowNewWeapon(self, j, false, self.origin + (self.mins + self.maxs) * 0.5, randomvec() * 175 + '0 0 325');
+ FOREACH(Weapons, it != WEP_Null, LAMBDA(
+ if(self.weapons & WepSet_FromWeapon(it))
+ if(PS(self).m_switchweapon != it)
+ if(W_IsWeaponThrowable(it.m_id))
+ W_ThrowNewWeapon(self, it.m_id, false, CENTER_OR_VIEWOFS(self), randomvec() * 175 + '0 0 325');
+ ));
return true;
}