From 5dc61988788e44bc87e8c57c0beded97d4efdf05 Mon Sep 17 00:00:00 2001 From: lhofhansl Date: Wed, 30 Nov 2016 00:13:14 -0800 Subject: Optimize/adjust blocks/ActiveObjects sent at the server based on client settings. (#4811) Optimize/adjust blocks and active blocks sent at the server based on client settings. --- src/content_sao.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/content_sao.cpp') diff --git a/src/content_sao.cpp b/src/content_sao.cpp index 609673ed9..77ab51a02 100644 --- a/src/content_sao.cpp +++ b/src/content_sao.cpp @@ -781,6 +781,8 @@ PlayerSAO::PlayerSAO(ServerEnvironment *env_, u16 peer_id_, bool is_singleplayer m_attachment_sent(false), m_breath(PLAYER_MAX_BREATH), m_pitch(0), + m_fov(0), + m_wanted_range(0), // public m_physics_override_speed(1), m_physics_override_jump(1), @@ -1099,6 +1101,22 @@ void PlayerSAO::setYaw(const float yaw) UnitSAO::setYaw(yaw); } +void PlayerSAO::setFov(const float fov) +{ + if (m_player && fov != m_fov) + m_player->setDirty(true); + + m_fov = fov; +} + +void PlayerSAO::setWantedRange(const s16 range) +{ + if (m_player && range != m_wanted_range) + m_player->setDirty(true); + + m_wanted_range = range; +} + void PlayerSAO::setYawAndSend(const float yaw) { setYaw(yaw); -- cgit v1.2.3