diff options
author | Anand S <ClobberXD@gmail.com> | 2018-07-15 05:56:30 +0530 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2019-09-19 20:14:16 +0200 |
commit | 47da640d7763ee1e00badb7476ac5afc4f864367 (patch) | |
tree | d12bee2e2cfc1b1c4a4a51e318d692b11ee5fbaf /src/network/clientpackethandler.cpp | |
parent | 5c9983400fb085167bf11f8a0483b8e8f6dd8a24 (diff) | |
download | minetest-47da640d7763ee1e00badb7476ac5afc4f864367.tar.gz minetest-47da640d7763ee1e00badb7476ac5afc4f864367.tar.bz2 minetest-47da640d7763ee1e00badb7476ac5afc4f864367.zip |
Add support for per-player FOV overrides and multipliers
Diffstat (limited to 'src/network/clientpackethandler.cpp')
-rw-r--r-- | src/network/clientpackethandler.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/network/clientpackethandler.cpp b/src/network/clientpackethandler.cpp index d47571d14..b6e9defb0 100644 --- a/src/network/clientpackethandler.cpp +++ b/src/network/clientpackethandler.cpp @@ -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; |