diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-03-06 14:09:43 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-03-06 14:09:43 -0500 |
commit | 8617b8c8cfad0d16eb244c884cb1fa594811ba59 (patch) | |
tree | 276a5d3532261b319919e0147082ec63579f1dfe /src | |
parent | 6e7146714e0af2145c8c6cda3da4e2a54b469cb6 (diff) | |
download | lingo-ap-tracker-8617b8c8cfad0d16eb244c884cb1fa594811ba59.tar.gz lingo-ap-tracker-8617b8c8cfad0d16eb244c884cb1fa594811ba59.tar.bz2 lingo-ap-tracker-8617b8c8cfad0d16eb244c884cb1fa594811ba59.zip |
Prevent reachability checks when player moves
Diffstat (limited to 'src')
-rw-r--r-- | src/ap_state.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
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 { | |||
398 | } | 398 | } |
399 | 399 | ||
400 | void OnSetReply(const std::string& key, const nlohmann::json& value) { | 400 | void OnSetReply(const std::string& key, const nlohmann::json& value) { |
401 | bool should_refresh = false; | ||
402 | bool should_redraw_position = false; | ||
401 | { | 403 | { |
402 | std::lock_guard state_guard(state_mutex); | 404 | std::lock_guard state_guard(state_mutex); |
403 | HandleDataStorage(key, value); | 405 | HandleDataStorage(key, value); |
406 | |||
407 | if (key.ends_with("PlayerPos")) | ||
408 | { | ||
409 | should_redraw_position = true; | ||
410 | } else { | ||
411 | should_refresh = true; | ||
412 | } | ||
404 | } | 413 | } |
405 | 414 | ||
406 | RefreshTracker(false); | 415 | if (should_refresh) |
416 | { | ||
417 | RefreshTracker(false); | ||
418 | } else if (should_redraw_position) { | ||
419 | tracker_frame->RedrawPosition(); | ||
420 | } | ||
407 | } | 421 | } |
408 | 422 | ||
409 | void OnSlotConnected(std::string player, std::string server, | 423 | void OnSlotConnected(std::string player, std::string server, |