Skip to content

Commit

Permalink
Reworked cvar mp_deathmsg_flags (use flags instead of bitsums)
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Nov 8, 2023
1 parent 96e2121 commit 2857986
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab
| mp_hostages_rescued_ratio | 1.0 | 0.0 | 1.0 | Ratio of hostages rescued to win the round. |
| mp_legacy_vehicle_block | 1 | 0 | 1 | Legacy func_vehicle behavior when blocked by another entity.<br/>`0` New behavior <br/>`1` Legacy behavior |
| mp_dying_time | 3.0 | 0.0 | - | Time for switch to free observing after death.<br/>`0` - disable spectating around death.<br/>`>0.00001` - time delay to start spectate.<br/>`NOTE`: The countdown starts when the player’s death animation is finished. |
| mp_deathmsg_flags | 7 | 0 | 7 | Sets a bitsum for extra information in the player's death message.<br/>`0` disabled<br/>`1` position where the victim died<br/>`2` index of the assistant who helped the attacker kill the victim<br/>`4` rarity classification bits, e.g., `blinkill`, `noscope`, `penetrated`, etc. |
| mp_deathmsg_flags | abc | 0 | - | Sets a flags for extra information in the player's death message.<br/>`0` disabled<br/>`a` position where the victim died<br/>`b` index of the assistant who helped the attacker kill the victim<br/>`c` rarity classification bits, e.g., `blinkill`, `noscope`, `penetrated`, etc. |
| mp_assist_damage_threshold | 40 | 0 | 100 | Sets the percentage of damage needed to score an assist. |
</details>

Expand Down
12 changes: 6 additions & 6 deletions dist/game.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -538,16 +538,16 @@ mp_legacy_vehicle_block "1"
// Default value: "3.0"
mp_dying_time "3.0"
// Sets a bitsum for extra information in the player's death message
// Sets a flags for extra information in the player's death message
//
// 1 Position where the victim died
// 2 Index of the assistant who helped the attacker kill the victim
// 4 Rarity classification bits, e.g., blinkill, noscope, penetrated, etc
// a - Position where the victim died
// b - Index of the assistant who helped the attacker kill the victim
// c - Rarity classification bits, e.g., blinkill, noscope, penetrated, etc
//
// Set to "0" to send no extra information about death
//
// Default value: "7"
mp_deathmsg_flags "7"
// Default value: "abc"
mp_deathmsg_flags "abc"

// Sets the percentage of damage needed to score an assist
//
Expand Down
2 changes: 1 addition & 1 deletion regamedll/dlls/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ cvar_t sv_autobunnyhopping = { "sv_autobunnyhopping", "0", 0, 0.0f
cvar_t sv_enablebunnyhopping = { "sv_enablebunnyhopping", "0", 0, 0.0f, nullptr };
cvar_t plant_c4_anywhere = { "mp_plant_c4_anywhere", "0", 0, 0.0f, nullptr };
cvar_t give_c4_frags = { "mp_give_c4_frags", "3", 0, 3.0f, nullptr };
cvar_t deathmsg_flags = { "mp_deathmsg_flags", "7", 0, 7.0f, nullptr };
cvar_t deathmsg_flags = { "mp_deathmsg_flags", "abc", 0, 0.0f, nullptr };
cvar_t assist_damage_threshold = { "mp_assist_damage_threshold", "40", 0, 40.0f, nullptr };

cvar_t hostages_rescued_ratio = { "mp_hostages_rescued_ratio", "1.0", 0, 1.0f, nullptr };
Expand Down
2 changes: 1 addition & 1 deletion regamedll/dlls/multiplay_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5340,7 +5340,7 @@ void EXT_FUNC CHalfLifeMultiplay::__API_HOOK(SendDeathMessage)(CBaseEntity *pKil
WRITE_STRING(killerWeaponName); // what they were killed by (should this be a string?)

#ifdef REGAMEDLL_ADD
iDeathMessageFlags &= (int)deathmsg_flags.value; // leave only allowed bitsums for extra info
iDeathMessageFlags &= UTIL_ReadFlags(deathmsg_flags.string); // leave only allowed bitsums for extra info

// Send the victim's death position only
// 1. if it is not a free for all mode
Expand Down

0 comments on commit 2857986

Please sign in to comment.