MUTATOR_HOOKFUNCTION(nt, SetModname)
{
- modname = "NewToys";
- return 0;
+ M_ARGV(0, string) = "NewToys";
}
bool nt_IsNewToy(int w)
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