From 22155b57eba5618a655df9323c5f716a0e5a3eee Mon Sep 17 00:00:00 2001 From: "Dr. Jaska" Date: Wed, 10 May 2023 17:21:08 +0000 Subject: [PATCH] Monster loot off-switch --- monsters.cfg | 1 + qcsrc/common/monsters/sv_monsters.qc | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/monsters.cfg b/monsters.cfg index 94e25eb47..b64c846e9 100644 --- a/monsters.cfg +++ b/monsters.cfg @@ -99,6 +99,7 @@ set g_monsters_think_delay 0.03333 set g_monsters_skill 1 "Monster skill (affecting some of their attributes). 1 - easy, 2 - medium, 3 - hard, 4 - insane, 5 - nightmare" set g_monsters_miniboss_chance 5 set g_monsters_miniboss_healthboost 100 +set g_monsters_drop 1 set g_monsters_drop_time 10 set g_monsters_ignoretraces 1 set g_monsters_lineofsight 1 diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 1635b5cb0..7d644fa36 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -36,9 +36,10 @@ void monsters_setstatus(entity this) STAT(MONSTERS_KILLED, this) = monsters_killed; } +bool autocvar_g_monsters_drop = true; void monster_dropitem(entity this, entity attacker) { - if(!this.candrop || !this.monster_loot) + if(!this.candrop || !this.monster_loot || !autocvar_g_monsters_drop) return; vector org = CENTER_OR_VIEWOFS(this); @@ -976,7 +977,7 @@ void Monster_Dead(entity this, entity attacker, float gibbed) Monster mon = this.monsterdef; mon.mr_death(mon, this); - if(this.candrop && this.weapon) + if(this.candrop && this.weapon && autocvar_g_monsters_drop) { .entity weaponentity = weaponentities[0]; // TODO: unhardcode W_ThrowNewWeapon(this, this.weapon, 0, this.origin, randomvec() * 150 + '0 0 325', weaponentity); -- 2.39.2