Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QC, DOCS: Added infokey for disabling backpacks in deathmatch #191

Merged
merged 1 commit into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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