]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/new_toys/new_toys.qc
Gametype Votescreen: Remove the _icon cvar for custom gametypes as it is not needed...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / new_toys / new_toys.qc
index ab0567d3a3fb54d8d3ff7f9314135a43aaeae6c0..27d1795062cefb8c73275a4eabbb2cceef74643c 100644 (file)
@@ -110,8 +110,7 @@ const float NT_AUTOREPLACE_RANDOM = 2;
 
 MUTATOR_HOOKFUNCTION(nt, SetModname)
 {
-       modname = "NewToys";
-       return 0;
+       M_ARGV(0, string) = "NewToys";
 }
 
 bool nt_IsNewToy(int w)
@@ -192,36 +191,39 @@ MUTATOR_HOOKFUNCTION(nt, SetStartItems)
        warmup_newdefault &= warmup_start_weapons_defaultmask;
        warmup_start_weapons &= ~warmup_start_weapons_defaultmask;
        warmup_start_weapons |= warmup_newdefault;
-
-       return 0;
 }
 
 MUTATOR_HOOKFUNCTION(nt, SetWeaponreplace)
-{SELFPARAM();
+{
+       entity wep = M_ARGV(0, entity);
+       entity wepinfo = M_ARGV(1, entity);
+       string ret_string = M_ARGV(2, string);
+
        // otherwise, we do replace
-       if(self.new_toys)
+       if(wep.new_toys)
        {
                // map defined replacement:
-               ret_string = self.new_toys;
+               ret_string = wep.new_toys;
        }
        else
        {
                // auto replacement:
-               ret_string = nt_GetReplacement(other.netname, autocvar_g_new_toys_autoreplace);
+               ret_string = nt_GetReplacement(wepinfo.netname, autocvar_g_new_toys_autoreplace);
        }
 
        // apply regular weaponreplace
        ret_string = W_Apply_Weaponreplace(ret_string);
 
-       return 0;
+       M_ARGV(2, string) = ret_string;
 }
 
 MUTATOR_HOOKFUNCTION(nt, FilterItem)
-{SELFPARAM();
-       if(nt_IsNewToy(self.weapon) && autocvar_g_new_toys_use_pickupsound) {
-               self.item_pickupsound = string_null;
-               self.item_pickupsound_ent = SND_WEAPONPICKUP_NEW_TOYS;
+{
+       entity item = M_ARGV(0, entity);
+
+       if(nt_IsNewToy(item.weapon) && autocvar_g_new_toys_use_pickupsound) {
+               item.item_pickupsound = string_null;
+               item.item_pickupsound_ent = SND_WEAPONPICKUP_NEW_TOYS;
        }
-       return 0;
 }
 #endif