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

Add multi_hitsounds #158

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

is-this-c
Copy link
Contributor

No description provided.

if (g_additional_server_config.hit_sounds.enabled) {
auto& pdata = get_player_additional_data(killer_player);
if (pdata.multi_hitsounds) {
if (pdata.multi_hitsounds == 2) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum > magic constant

@@ -170,6 +170,8 @@ bool GameConfig::visit_vars(T&& visitor, bool is_save)
result &= visitor(dash_faction_key, "Big HUD", big_hud);
result &= visitor(dash_faction_key, "Reticle Scale", reticle_scale);
result &= visitor(dash_faction_key, "Mesh Static Lighting", mesh_static_lighting);
result &= visitor(dash_faction_key, "multi_hitsounds", multi_hitsounds);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep registry key naming convention

@@ -82,6 +82,8 @@ struct GameConfig
CfgVar<bool> glares = true;
CfgVar<bool> show_enemy_bullets = true;
CfgVar<bool> linear_pitch = false;
CfgVar<bool> multi_hitsounds = true;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some description in README about those modes because i'm not sure how this feature works currently

custom_packets::process_packet(data + offset, len, addr, player);
}
#else
custom_packets::process_packet(data + offset, len, addr, player);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be better if this could be not repeated - maybe use something like bool processed = false; if PF: processed = ...

custom_packets::send_hitsound_packet(killer_player);
}
}
else if (g_additional_server_config.hit_sounds.enabled) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want more configuration for the server owners so they can force hitsounds disabled, no matter what the client configured.
3 server-side modes: enable, disable, force disabled (naming suggestion, can be changed)
3 client-side modes: auto (use server setting), enable (if not forced disabled on the server), disable


float invalid = std::numeric_limits<float>::quiet_NaN();
rf::Vector3 position{invalid, invalid, invalid};
rf::snd_play_3d(29, position, 1.0f, rf::zero_vector, 0);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently sound id is configurable on the server. I'd like it to stay this way.

@is-this-c is-this-c marked this pull request as draft October 6, 2024 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants