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

Erase rf::local_player from g_player_additional_data_map upon leaving server. #317

Merged
merged 5 commits into from
Dec 10, 2024

Conversation

is-this-c
Copy link
Contributor

@is-this-c is-this-c commented Dec 9, 2024

Ensures received_ac_status etc. is cleared.

@is-this-c is-this-c marked this pull request as draft December 9, 2024 00:20
@is-this-c is-this-c changed the title Erase rf::local_player from g_player_additional_data_map Erase rf::local_player from g_player_additional_data_map upon leaving server. Dec 9, 2024
@is-this-c is-this-c marked this pull request as ready for review December 9, 2024 00:23
@@ -891,6 +891,10 @@ FunHook<void()> multi_stop_hook{
// Clear server info when leaving
g_df_server_info.reset();
multi_stop_hook.call_target();
if (rf::local_player) {
extern std::unordered_map<rf::Player*, PlayerAdditionalData> g_player_additional_data_map;
Copy link
Owner

Choose a reason for hiding this comment

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

I don't really like this way of accessing this variable. It wasn't intended to be public.
Could you add in player.cpp a function which removes the player from the map? e.g. remove/reset_player_additional_data(Player*)

@is-this-c is-this-c marked this pull request as draft December 10, 2024 12:00
@is-this-c is-this-c marked this pull request as ready for review December 10, 2024 12:03
@rafalh rafalh merged commit c0fec34 into rafalh:master Dec 10, 2024
2 checks passed
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