mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-12 16:58:39 +00:00
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.
This commit is contained in:
parent
c38985825f
commit
5dc6198878
11 changed files with 99 additions and 28 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue