diff --git a/src/d_main.cpp b/src/d_main.cpp index 5a97637ff9..f982cc5fbb 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -399,19 +399,19 @@ CUSTOM_CVAR (Int, dmflags, 0, CVAR_SERVERINFO) // If nofov is set, force everybody to the arbitrator's FOV. if ((self & DF_NO_FOV) && consoleplayer == Net_Arbitrator) { - uint8_t fov; + double fov; Net_WriteByte (DEM_FOV); // If the game is started with DF_NO_FOV set, the arbitrator's // DesiredFOV will not be set when this callback is run, so // be sure not to transmit a 0 FOV. - fov = (uint8_t)players[consoleplayer].DesiredFOV; + fov = players[consoleplayer].DesiredFOV; if (fov == 0) { fov = 90; } - Net_WriteByte (fov); + Net_WriteFloat (fov); } } diff --git a/src/d_net.cpp b/src/d_net.cpp index 77a560e60a..04269f1d88 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -2465,7 +2465,7 @@ void Net_DoCommand (int type, uint8_t **stream, int player) case DEM_FOV: { - float newfov = (float)ReadByte (stream); + float newfov = ReadFloat (stream); if (newfov != players[consoleplayer].DesiredFOV) { @@ -2485,7 +2485,7 @@ void Net_DoCommand (int type, uint8_t **stream, int player) break; case DEM_MYFOV: - players[player].DesiredFOV = (float)ReadByte (stream); + players[player].DesiredFOV = ReadFloat (stream); break; case DEM_RUNSCRIPT: @@ -2775,6 +2775,8 @@ void Net_SkipCommand (int type, uint8_t **stream) break; case DEM_INVUSE: + case DEM_FOV: + case DEM_MYFOV: skip = 4; break; @@ -2784,8 +2786,6 @@ void Net_SkipCommand (int type, uint8_t **stream) case DEM_GENERICCHEAT: case DEM_DROPPLAYER: - case DEM_FOV: - case DEM_MYFOV: case DEM_ADDCONTROLLER: case DEM_DELCONTROLLER: skip = 1; diff --git a/src/d_protocol.h b/src/d_protocol.h index f5bcf10fbd..ddae331a60 100644 --- a/src/d_protocol.h +++ b/src/d_protocol.h @@ -116,8 +116,8 @@ enum EDemoCommand DEM_UNDONE5, // 24 DEM_UNDONE6, // 25 DEM_SUMMON, // 26 String: Thing to fabricate - DEM_FOV, // 27 Byte: New FOV for all players - DEM_MYFOV, // 28 Byte: New FOV for this player + DEM_FOV, // 27 Float: New FOV for all players + DEM_MYFOV, // 28 Float: New FOV for this player DEM_CHANGEMAP2, // 29 Byte: Position in new map, String: name of new map DEM_UNDONE7, // 30 DEM_UNDONE8, // 31 diff --git a/src/p_user.cpp b/src/p_user.cpp index f9b9dd4a61..104e7d241e 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -614,7 +614,7 @@ void player_t::SetFOV(float fov) { Net_WriteByte(DEM_MYFOV); } - Net_WriteByte((uint8_t)clamp(fov, 5.f, 179.f)); + Net_WriteFloat(clamp(fov, 5.f, 179.f)); } }