From 8617b8c8cfad0d16eb244c884cb1fa594811ba59 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 6 Mar 2025 14:09:43 -0500 Subject: Prevent reachability checks when player moves --- src/ap_state.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/ap_state.cpp') diff --git a/src/ap_state.cpp b/src/ap_state.cpp index 4ac0cce..2236d6a 100644 --- a/src/ap_state.cpp +++ b/src/ap_state.cpp @@ -398,12 +398,26 @@ struct APState { } void OnSetReply(const std::string& key, const nlohmann::json& value) { + bool should_refresh = false; + bool should_redraw_position = false; { std::lock_guard state_guard(state_mutex); HandleDataStorage(key, value); + + if (key.ends_with("PlayerPos")) + { + should_redraw_position = true; + } else { + should_refresh = true; + } } - RefreshTracker(false); + if (should_refresh) + { + RefreshTracker(false); + } else if (should_redraw_position) { + tracker_frame->RedrawPosition(); + } } void OnSlotConnected(std::string player, std::string server, -- cgit 1.4.1