From: Freddy Date: Mon, 17 Oct 2016 23:02:36 +0000 (+0200) Subject: Replace m_itemid with itemdef for nix item filter X-Git-Tag: xonotic-v0.8.2~450^2~8 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a3e036cb4521be79337e29ea91488a663821b519;p=xonotic%2Fxonotic-data.pk3dir.git Replace m_itemid with itemdef for nix item filter --- diff --git a/qcsrc/common/mutators/mutator/nix/sv_nix.qc b/qcsrc/common/mutators/mutator/nix/sv_nix.qc index 39072cefc..ded7f72eb 100644 --- a/qcsrc/common/mutators/mutator/nix/sv_nix.qc +++ b/qcsrc/common/mutators/mutator/nix/sv_nix.qc @@ -232,24 +232,13 @@ MUTATOR_HOOKFUNCTION(nix, FilterItem) { entity item = M_ARGV(0, entity); - switch (item.items) + if(item.itemdef.instanceOfHealth || item.itemdef.instanceOfArmor) { - case ITEM_HealthSmall.m_itemid: - case ITEM_HealthMedium.m_itemid: - case ITEM_HealthLarge.m_itemid: - case ITEM_HealthMega.m_itemid: - case ITEM_ArmorSmall.m_itemid: - case ITEM_ArmorMedium.m_itemid: - case ITEM_ArmorLarge.m_itemid: - case ITEM_ArmorMega.m_itemid: - if (autocvar_g_nix_with_healtharmor) - return false; - break; - case ITEM_Strength.m_itemid: - case ITEM_Shield.m_itemid: - if (autocvar_g_nix_with_powerups) - return false; - break; + return !autocvar_g_nix_with_healtharmor; + } + else if(item.itemdef == ITEM_Strength || item.itemdef == ITEM_Shield) + { + return !autocvar_g_nix_with_powerups; } return true; // delete all other items