mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-17 18:35:20 +02: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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user