ChillerDragon / ddnet

Chillers contribution fork of DDraceNetwork, a cooperative racing mod of Teeworlds
https://ddnet.tw/
Other
0 stars 0 forks source link

ChillerDragon:pr_07_client free view is broken #12

Closed ChillerDragon closed 3 months ago

ChillerDragon commented 3 months ago

Another issue i found is that Free-View option in spectator menu simply doesnt work on 0.7 based servers (also theres no option to spectate flags but thats rather not a bug so its fine i think)

image

ChillerDragon commented 3 months ago

Fixed

diff --git a/src/game/client/components/spectator.cpp b/src/game/client/components/spectator.cpp
index 16fd31a33..11b4fd383 100644
--- a/src/game/client/components/spectator.cpp
+++ b/src/game/client/components/spectator.cpp
@@ -561,8 +561,16 @@ void CSpectator::Spectate(int SpectatorId)
        if(Client()->IsSixup())
        {
                protocol7::CNetMsg_Cl_SetSpectatorMode Msg;
-               Msg.m_SpecMode = protocol7::SPEC_PLAYER;
-               Msg.m_SpectatorId = SpectatorId;
+               if(SpectatorId == SPEC_FREEVIEW)
+               {
+                       Msg.m_SpecMode = protocol7::SPEC_FREEVIEW;
+                       Msg.m_SpectatorId = -1;
+               }
+               else
+               {
+                       Msg.m_SpecMode = protocol7::SPEC_PLAYER;
+                       Msg.m_SpectatorId = SpectatorId;
+               }
                Client()->SendPackMsgActive(&Msg, MSGFLAG_VITAL, true);
                return;
        }
ChillerDragon commented 3 months ago

Missing flags is out of scope for now. We can add it later once the basic support is merged into ddnet.