1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Add support for per-player FOV overrides and multipliers

This commit is contained in:
Anand S 2018-07-15 05:56:30 +05:30 committed by sfan5
parent 5c9983400f
commit 47da640d77
13 changed files with 168 additions and 62 deletions

View file

@ -523,13 +523,22 @@ void Client::handleCommand_Movement(NetworkPacket* pkt)
player->movement_gravity = g * BS;
}
void Client::handleCommand_HP(NetworkPacket* pkt)
void Client::handleCommand_Fov(NetworkPacket *pkt)
{
f32 fov;
bool is_multiplier;
*pkt >> fov >> is_multiplier;
LocalPlayer *player = m_env.getLocalPlayer();
player->setFov({ fov, is_multiplier });
}
void Client::handleCommand_HP(NetworkPacket *pkt)
{
LocalPlayer *player = m_env.getLocalPlayer();
assert(player != NULL);
u16 oldhp = player->hp;
u16 oldhp = player->hp;
u16 hp;
*pkt >> hp;