diff options
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/client.cpp | 11 | ||||
-rw-r--r-- | src/client/clientenvironment.h | 5 | ||||
-rw-r--r-- | src/client/clientobject.h | 1 | ||||
-rw-r--r-- | src/client/content_cao.h | 2 |
4 files changed, 12 insertions, 7 deletions
diff --git a/src/client/client.cpp b/src/client/client.cpp index bbc32c6d4..d3e7a278d 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -1289,9 +1289,6 @@ void Client::sendReady() void Client::sendPlayerPos(v3f pos) { - if (g_settings->getBool("freecam")) - return; - LocalPlayer *player = m_env.getLocalPlayer(); if (!player) return; @@ -1309,7 +1306,7 @@ void Client::sendPlayerPos(v3f pos) if ( player->last_position == pos && - player->last_speed == player->getSpeed() && + player->last_speed == player->getLegitSpeed() && player->last_pitch == player->getPitch() && player->last_yaw == player->getYaw() && player->last_keyPressed == player->keyPressed && @@ -1318,7 +1315,7 @@ void Client::sendPlayerPos(v3f pos) return; player->last_position = pos; - player->last_speed = player->getSpeed(); + player->last_speed = player->getLegitSpeed(); player->last_pitch = player->getPitch(); player->last_yaw = player->getYaw(); player->last_keyPressed = player->keyPressed; @@ -1337,7 +1334,7 @@ void Client::sendPlayerPos() LocalPlayer *player = m_env.getLocalPlayer(); if (!player) return; - sendPlayerPos(player->getPosition()); + sendPlayerPos(player->getLegitPosition()); } void Client::removeNode(v3s16 p) @@ -1678,7 +1675,7 @@ void Client::updateAllMapBlocks() MapBlockVect blocks; sector->getBlocks(blocks); for (MapBlock *block : blocks) { - addUpdateMeshTask(block->getPos(), false, true); + addUpdateMeshTask(block->getPos(), false, false); } } } diff --git a/src/client/clientenvironment.h b/src/client/clientenvironment.h index 864496a41..52d999c99 100644 --- a/src/client/clientenvironment.h +++ b/src/client/clientenvironment.h @@ -92,6 +92,11 @@ public: { return m_ao_manager.getActiveObject(id); } + + std::unordered_map<u16, ClientActiveObject*> getAllActiveObjects() + { + return m_ao_manager.getAllActiveObjects(); + } /* Adds an active object to the environment. diff --git a/src/client/clientobject.h b/src/client/clientobject.h index ecd8059ef..19f8e3b72 100644 --- a/src/client/clientobject.h +++ b/src/client/clientobject.h @@ -44,6 +44,7 @@ public: virtual void updateLight(u32 day_night_ratio) {} + virtual bool isItem() const { return false; } virtual bool getCollisionBox(aabb3f *toset) const { return false; } virtual bool getSelectionBox(aabb3f *toset) const { return false; } virtual bool collideWithObjects() const { return false; } diff --git a/src/client/content_cao.h b/src/client/content_cao.h index 88aa4870c..51b58b030 100644 --- a/src/client/content_cao.h +++ b/src/client/content_cao.h @@ -215,6 +215,8 @@ public: m_is_visible = toset; } + bool isItem() const { return m_prop.visual == "wielditem" || m_prop.visual == "item"; } + void setChildrenVisible(bool toset); void setAttachment(int parent_id, const std::string &bone, v3f position, v3f rotation); void getAttachment(int *parent_id, std::string *bone, v3f *position, |