diff --git a/src/client/camera.cpp b/src/client/camera.cpp index 8658212a8..0a8b4b0a7 100644 --- a/src/client/camera.cpp +++ b/src/client/camera.cpp @@ -373,13 +373,6 @@ void Camera::notifyFovChange() } } -// Returns the fractional part of x -inline f32 my_modf(f32 x) -{ - float dummy; - return std::modf(x, &dummy); -} - void Camera::step(f32 dtime) { for (auto node : m_wieldnodes) @@ -392,14 +385,6 @@ void Camera::step(f32 dtime) m_view_bobbing_fall = -1; // Mark the effect as finished } - bool was_under_zero = m_wield_change_timer < 0; - m_wield_change_timer = MYMIN(m_wield_change_timer + dtime, 0.125); - - if (m_wield_change_timer >= 0 && was_under_zero) { - m_wieldnode->setItem(m_wield_item_next, m_client); - m_wieldnode->setNodeLightColor(m_player_light_color); - } - if (m_view_bobbing_state != 0) { //f32 offset = dtime * m_view_bobbing_speed * 0.035; @@ -437,26 +422,6 @@ void Camera::step(f32 dtime) } } } - - if (m_digging_button != -1) { - f32 offset = dtime * 3.5f; - float m_digging_anim_was = m_digging_anim; - m_digging_anim += offset; - if (m_digging_anim >= 1) - { - m_digging_anim = 0; - m_digging_button = -1; - } - float lim = 0.15; - if(m_digging_anim_was < lim && m_digging_anim >= lim) - { - if (m_digging_button == 0) { - m_client->getEventManager()->put(new SimpleTriggerEvent(MtEvent::CAMERA_PUNCH_LEFT)); - } else if(m_digging_button == 1) { - m_client->getEventManager()->put(new SimpleTriggerEvent(MtEvent::CAMERA_PUNCH_RIGHT)); - } - } - } } void Camera::addArmInertia(f32 player_yaw) diff --git a/src/client/game.cpp b/src/client/game.cpp index 6e374b7d7..0a2120a4c 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -4231,14 +4231,6 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime, runData.damage_flash -= 384.0f * dtime; } - /* - ==================== End scene ==================== - */ - - driver->endScene(); - - stats->drawtime = tt_draw.stop(true); - g_profiler->graphAdd("Draw scene [us]", stats->drawtime); g_profiler->avg("Game::updateFrame(): update frame [ms]", tt_update.stop(true)); } diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index 8a8498892..1489d84c1 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -919,8 +919,8 @@ static inline void getWieldedItem(const PlayerSAO *playersao, std::optionalgetWieldedItem(&(*ret)); } -static inline bool getOffhandWieldedItem(const PlayerSAO *playersao, Optional &offhand, - Optional &place, IItemDefManager *idef, const PointedThing &pointed) +static inline bool getOffhandWieldedItem(const PlayerSAO *playersao, std::optional &offhand, + std::optional &place, IItemDefManager *idef, const PointedThing &pointed) { offhand = ItemStack(); place = ItemStack(); @@ -1263,7 +1263,7 @@ void Server::handleCommand_Interact(NetworkPacket *pkt) if (use_offhand ? (offhand_item.has_value() && playersao->setOffhandWieldedItem(*offhand_item)) : (main_item.has_value() && playersao->setWieldedItem(*main_item))) - SendInventory(playersao, true); + SendInventory(player, true); } pointed_object->rightClick(playersao); @@ -1274,7 +1274,7 @@ void Server::handleCommand_Interact(NetworkPacket *pkt) if (use_offhand ? (offhand_item.has_value() && playersao->setOffhandWieldedItem(*offhand_item)) : (main_item.has_value() && playersao->setWieldedItem(*main_item))) - SendInventory(playersao, true); + SendInventory(player, true); } if (pointed.type != POINTEDTHING_NODE) diff --git a/src/server/player_sao.h b/src/server/player_sao.h index 3b54d642a..cde1ab77e 100644 --- a/src/server/player_sao.h +++ b/src/server/player_sao.h @@ -27,6 +27,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "util/numeric.h" #include "util/pointedthing.h" +class IItemDefManager; + /* PlayerSAO needs some internals exposed. */