Skip to content

Commit

Permalink
Merge pull request #191 from lavenderdotpet/zungryware/remove-backpac…
Browse files Browse the repository at this point in the history
…ks-infokey

QC, DOCS: Added infokey for disabling backpacks in deathmatch
  • Loading branch information
Zungrysoft authored Nov 2, 2024
2 parents 345714a + 9582fc7 commit 20b5305
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/deathmatch-setup-guide.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ serverinfo rj 20 Scales rocket jump push force by a factor of 20. (Set to 0
serverinfo have_axe_only 1 Disables all weapons except for the axe.
serverinfo buffed_axe 1 Increases the axe's damage.
serverinfo have_unlimited_ammo 1 Players have unlimited ammo.
serverinfo disable_backpacks 1 Players do not drop weapon or ammo backpacks on death.

serverinfo have_super_shotgun 1 Players spawn with the Double-Barreled Shotgun.
serverinfo have_nailgun 1 Players spawn with the Nailgun.
Expand Down
11 changes: 11 additions & 0 deletions qcsrc/deathmatch_settings.qc
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,17 @@ float() deathmatch_no_mega_health =
return FALSE;
};

// Stops players from dropping backpacks on death
float() deathmatch_no_backpacks =
{
#ifdef __QW__ // NQ does not support infokeys
if (deathmatch && stof(infokey(world, "disable_backpacks")) != 0)
return TRUE;
#endif

return FALSE;
};

// Quad is dropped on death
float() deathmatch_drop_quad =
{
Expand Down
2 changes: 1 addition & 1 deletion qcsrc/player.qc
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ void() PlayerDie =
self.radsuit_finished = 0;
self.modelindex = modelindex_player; // don't use eyes

if (deathmatch || coop)
if ((deathmatch || coop) && !deathmatch_no_backpacks())
DropBackpack();

self.weaponmodel=string_null;
Expand Down

0 comments on commit 20b5305

Please sign in to comment.