// ================
// unlimited ammo
// ================
-set g_unlimitedammo 0 "Enable unlimited ammo for game"
\ No newline at end of file
+set g_unlimitedammo 0 "Enable unlimited ammo for game"
+set g_unlimitedammo_remove_loot 0 "Remove dropping loot from players after they dies when unlimited ammo mode is on"
\ No newline at end of file
#include "sv_unlimitedammo.qh"
-bool autocvar_g_unlimitedammo;
+bool autocvar_g_unlimitedammo_remove_loot;
REGISTER_MUTATOR(unlimitedammo, cvar("g_unlimitedammo"));
-
MUTATOR_HOOKFUNCTION(unlimitedammo, SetStartItems)
{
- if (autocvar_g_unlimitedammo) {
- start_items |= IT_UNLIMITED_AMMO;
+ start_items |= IT_UNLIMITED_AMMO;
+}
+
+MUTATOR_HOOKFUNCTION(unlimitedammo, FilterItem)
+{
+ entity item = M_ARGV(0, entity);
+ if (Item_IsLoot(item) && autocvar_g_unlimitedammo_remove_loot) {
+ remove(item);
}
}
\ No newline at end of file