-
Notifications
You must be signed in to change notification settings - Fork 15
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
base: master
Are you sure you want to change the base?
Add multi_hitsounds #158
Conversation
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) { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
No description provided.