summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorANAND <ClobberXD@gmail.com>2019-08-25 06:24:21 +0530
committersfan5 <sfan5@live.de>2019-09-14 20:16:55 +0200
commit81c7f0ae044b1131ad082e5e705c5276f82ac6ce (patch)
tree7de042695c5429d0b6cb75b18998174e6e53a9f6 /src/client
parent9acd36bf9981cf9cb8e82785508d6eb7f010cc77 (diff)
downloadminetest-81c7f0ae044b1131ad082e5e705c5276f82ac6ce.tar.gz
minetest-81c7f0ae044b1131ad082e5e705c5276f82ac6ce.tar.bz2
minetest-81c7f0ae044b1131ad082e5e705c5276f82ac6ce.zip
Send ActiveObjects once right after Init2
Diffstat (limited to 'src/client')
-rw-r--r--src/client/client.cpp10
-rw-r--r--src/client/client.h3
2 files changed, 11 insertions, 2 deletions
diff --git a/src/client/client.cpp b/src/client/client.cpp
index f6be3186f..ce09f343c 100644
--- a/src/client/client.cpp
+++ b/src/client/client.cpp
@@ -1243,8 +1243,14 @@ void Client::sendPlayerPos()
u8 camera_fov = map.getCameraFov();
u8 wanted_range = map.getControl().wanted_range;
- // Save bandwidth by only updating position when something changed
- if(myplayer->last_position == myplayer->getPosition() &&
+ // Save bandwidth by only updating position when
+ // player is not dead and something changed
+
+ if (m_activeobjects_received && myplayer->isDead())
+ return;
+
+ if (
+ myplayer->last_position == myplayer->getPosition() &&
myplayer->last_speed == myplayer->getSpeed() &&
myplayer->last_pitch == myplayer->getPitch() &&
myplayer->last_yaw == myplayer->getYaw() &&
diff --git a/src/client/client.h b/src/client/client.h
index 6dad48c3d..934175ff2 100644
--- a/src/client/client.h
+++ b/src/client/client.h
@@ -339,6 +339,8 @@ public:
{ return m_nodedef_received; }
bool mediaReceived()
{ return !m_media_downloader; }
+ const bool activeObjectsReceived() const
+ { return m_activeobjects_received; }
u16 getProtoVersion()
{ return m_proto_ver; }
@@ -539,6 +541,7 @@ private:
std::queue<ClientEvent *> m_client_event_queue;
bool m_itemdef_received = false;
bool m_nodedef_received = false;
+ bool m_activeobjects_received = false;
bool m_mods_loaded = false;
ClientMediaDownloader *m_media_downloader;