]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/mutators/mutator/nix/nix.qc
Kill the ret_string global
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / mutators / mutator / nix / nix.qc
index 5a4df3ea413b3ab1cfe8d7434bc1367cdae77aaa..238e7fbacdcd8648fb85b6b2ba4d9e0e840af1f2 100644 (file)
@@ -220,19 +220,19 @@ MUTATOR_HOOKFUNCTION(nix, ForbidThrowCurrentWeapon)
 
 MUTATOR_HOOKFUNCTION(nix, BuildMutatorsString)
 {
-       ret_string = strcat(ret_string, ":NIX");
-       return false;
+       M_ARGV(0, string) = strcat(M_ARGV(0, string), ":NIX");
 }
 
 MUTATOR_HOOKFUNCTION(nix, BuildMutatorsPrettyString)
 {
-       ret_string = strcat(ret_string, ", NIX");
-       return false;
+       M_ARGV(0, string) = strcat(M_ARGV(0, string), ", NIX");
 }
 
 MUTATOR_HOOKFUNCTION(nix, FilterItem)
-{SELFPARAM();
-       switch (self.items)
+{
+       entity item = M_ARGV(0, entity);
+
+       switch (item.items)
        {
                case ITEM_HealthSmall.m_itemid:
                case ITEM_HealthMedium.m_itemid:
@@ -256,8 +256,10 @@ MUTATOR_HOOKFUNCTION(nix, FilterItem)
 }
 
 MUTATOR_HOOKFUNCTION(nix, OnEntityPreSpawn)
-{SELFPARAM();
-       if(self.classname == "target_items") // items triggers cannot work in nix (as they change weapons/ammo)
+{
+       entity ent = M_ARGV(0, entity);
+
+       if(ent.classname == "target_items") // items triggers cannot work in nix (as they change weapons/ammo)
                return true;
        return false;
 }
@@ -283,7 +285,7 @@ MUTATOR_HOOKFUNCTION(nix, PlayerSpawn)
 
 MUTATOR_HOOKFUNCTION(nix, SetModname, CBC_ORDER_LAST)
 {
-       modname = "NIX";
+       M_ARGV(0, string) = "NIX";
        return false;
 }
 #endif