#include "sv_melee_only.qh"
-REGISTER_MUTATOR(melee_only, cvar("g_melee_only") && !cvar("g_instagib") && !cvar("g_overkill") && !g_nexball);
+string autocvar_g_melee_only;
+REGISTER_MUTATOR(melee_only, expr_evaluate(autocvar_g_melee_only) && !cvar("g_instagib") && !cvar("g_overkill") && !g_nexball);
MUTATOR_HOOKFUNCTION(melee_only, SetStartItems, CBC_ORDER_LAST)
{
start_weapons = warmup_start_weapons = WEPSET(SHOTGUN);
}
+MUTATOR_HOOKFUNCTION(melee_only, SetWeaponArena)
+{
+ // turn weapon arena off
+ M_ARGV(0, string) = "off";
+}
+
+MUTATOR_HOOKFUNCTION(melee_only, ForbidRandomStartWeapons)
+{
+ return true;
+}
+
MUTATOR_HOOKFUNCTION(melee_only, ForbidThrowCurrentWeapon)
{
return true;
{
entity item = M_ARGV(0, entity);
- switch (item.items)
+ switch (item.itemdef)
{
- case ITEM_HealthSmall.m_itemid:
- case ITEM_ArmorSmall.m_itemid:
+ case ITEM_HealthSmall:
+ case ITEM_ArmorSmall:
return false;
}