summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 0a571b3f2..619150ef9 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -3452,6 +3452,26 @@ void LocalPlayer::pingRequest()
Net::getBeingHandler()->requestNameById(getId());
}
+int LocalPlayer::getPingTime() const
+{
+ int time = 0;
+ if (!mWaitPing)
+ {
+ time = mPingTime;
+ }
+ else
+ {
+ time = tick_time;
+ if (time > mPingSendTick)
+ {
+ time -= mPingSendTick;
+ if (time <= mPingTime)
+ time = mPingTime;
+ }
+ }
+ return time;
+}
+
void LocalPlayer::pingResponse()
{
if (mWaitPing == true && mPingSendTick > 0)