]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/melee_only/melee_only.qc
Remove unnecessary returns
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / melee_only / melee_only.qc
index 5b03f46ec1ecae87a694b8e521c27ad0d849a4d1..ecd5fc7c8e49cebf4e8949b3bf4096b1bf344b49 100644 (file)
@@ -5,8 +5,6 @@ MUTATOR_HOOKFUNCTION(melee_only, SetStartItems)
 {
        start_ammo_shells = warmup_start_ammo_shells = 0;
        start_weapons = warmup_start_weapons = WEPSET(SHOTGUN);
-
-       return false;
 }
 
 MUTATOR_HOOKFUNCTION(melee_only, ForbidThrowCurrentWeapon)
@@ -15,8 +13,10 @@ MUTATOR_HOOKFUNCTION(melee_only, ForbidThrowCurrentWeapon)
 }
 
 MUTATOR_HOOKFUNCTION(melee_only, FilterItem)
-{SELFPARAM();
-       switch (self.items)
+{
+       entity item = M_ARGV(0, entity);
+
+       switch (item.items)
        {
                case ITEM_HealthSmall.m_itemid:
                case ITEM_ArmorSmall.m_itemid:
@@ -28,13 +28,11 @@ MUTATOR_HOOKFUNCTION(melee_only, FilterItem)
 
 MUTATOR_HOOKFUNCTION(melee_only, BuildMutatorsString)
 {
-       ret_string = strcat(ret_string, ":MeleeOnly");
-       return false;
+       M_ARGV(0, string) = strcat(M_ARGV(0, string), ":MeleeOnly");
 }
 
 MUTATOR_HOOKFUNCTION(melee_only, BuildMutatorsPrettyString)
 {
-       ret_string = strcat(ret_string, ", Melee Only Arena");
-       return false;
+       M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Melee Only Arena");
 }
 #endif