X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Fmelee_only%2Fsv_melee_only.qc;h=2596770daa57be0c2b595873d79f18ecb40ee66f;hb=b2d3d4bf309925b54ac1f177ee9647b2aaf2bca4;hp=ac06a8f7747160259588667e74a20ba33878da9e;hpb=99b7900eda8efbe6e24a51667f5c50d0c179e614;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mutators/mutator/melee_only/sv_melee_only.qc b/qcsrc/common/mutators/mutator/melee_only/sv_melee_only.qc index ac06a8f77..2596770da 100644 --- a/qcsrc/common/mutators/mutator/melee_only/sv_melee_only.qc +++ b/qcsrc/common/mutators/mutator/melee_only/sv_melee_only.qc @@ -1,7 +1,9 @@ #include "sv_melee_only.qh" +#include "../overkill/sv_overkill.qh" + string autocvar_g_melee_only; -REGISTER_MUTATOR(melee_only, expr_evaluate(autocvar_g_melee_only) && !cvar("g_instagib") && !cvar("g_overkill") && !g_nexball); +REGISTER_MUTATOR(melee_only, expr_evaluate(autocvar_g_melee_only) && !MUTATOR_IS_ENABLED(mutator_instagib) && !MUTATOR_IS_ENABLED(ok) && !MapInfo_LoadedGametype.m_weaponarena); MUTATOR_HOOKFUNCTION(melee_only, SetStartItems, CBC_ORDER_LAST) { @@ -15,16 +17,21 @@ MUTATOR_HOOKFUNCTION(melee_only, SetWeaponArena) M_ARGV(0, string) = "off"; } +MUTATOR_HOOKFUNCTION(melee_only, ForbidRandomStartWeapons) +{ + return true; +} + MUTATOR_HOOKFUNCTION(melee_only, ForbidThrowCurrentWeapon) { return true; } -MUTATOR_HOOKFUNCTION(melee_only, FilterItem) +MUTATOR_HOOKFUNCTION(melee_only, FilterItemDefinition) { - entity item = M_ARGV(0, entity); + entity definition = M_ARGV(0, entity); - switch (item.itemdef) + switch (definition) { case ITEM_HealthSmall: case ITEM_ArmorSmall: