Skip to content

Commit 6192658

Browse files
committed
Made ping more reliable.
1 parent b17eb56 commit 6192658

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

core/net_utilities.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <memory>
1010

1111
void NS::PeerData::set_latency(int p_latency) {
12-
compressed_latency = std::round(float(std::min(p_latency, 1000)) / 4.0);
12+
compressed_latency = std::round(float(std::clamp(p_latency, 0, 1000)) / 4.0);
1313
}
1414

1515
int NS::PeerData::get_latency() const {

core/net_utilities.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ struct PeerData {
437437
PeerAuthorityData authority_data;
438438

439439
private:
440-
std::uint8_t compressed_latency = -1;
440+
std::uint8_t compressed_latency = 0;
441441

442442
public:
443443
// In ms

0 commit comments

Comments
 (0)