From b1d577af30474cfd0edaf5bac52f6381162a065a Mon Sep 17 00:00:00 2001 From: def Date: Thu, 20 Feb 2014 01:36:39 +0100 Subject: [PATCH] Huge fix with fake tunings --- src/game/server/gamecontext.cpp | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 9c8ecf850..669459f7d 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -472,24 +472,27 @@ void CGameContext::SendTuningParams(int ClientID) { if (m_apPlayers[ClientID] && m_apPlayers[ClientID]->GetCharacter() && m_apPlayers[ClientID]->GetCharacter()->NeededFaketuning()) // need to send faketunings ? { - if (m_apPlayers[ClientID]->GetCharacter()->NeededFaketuning() & FAKETUNE_FREEZE) + if((i==0 || i==1 || i==3 || i==4 || i==5 || i==6) // which tunings to fake + && m_apPlayers[ClientID]->GetCharacter()->NeededFaketuning() & FAKETUNE_FREEZE) { - if(i==0 || i==1 || i==3 || i==4 || i==5 || i==6) // which tunings to fake - Msg.AddInt(0); // send fake tunings selected above to the clients that they think they cant move - else if(i == 9 // bug in old ddnet versions - && (m_apPlayers[ClientID]->m_ClientVersion < VERSION_DDRACE - || m_apPlayers[ClientID]->m_ClientVersion >= VERSION_DDNET_GOODHOOK)) - // bug: hook_fire_speed 0 causes bugs even on vanilla, so we use hook_fire_speed 1 instead - Msg.AddInt(1); - else - Msg.AddInt(pParams[i]); + Msg.AddInt(0); // send fake tunings selected above to the clients that they think they cant move } - if (m_apPlayers[ClientID]->GetCharacter()->NeededFaketuning() & FAKETUNE_SOLO) + else if(i == 9 // bug in old ddnet versions + && (m_apPlayers[ClientID]->m_ClientVersion < VERSION_DDRACE + || m_apPlayers[ClientID]->m_ClientVersion >= VERSION_DDNET_GOODHOOK) + && m_apPlayers[ClientID]->GetCharacter()->NeededFaketuning() & FAKETUNE_FREEZE) { - if(i==31 || i==32) // collision and hooking - Msg.AddInt(0); // send fake tunings selected above to the clients that they think they cant move - else - Msg.AddInt(pParams[i]); + // bug: hook_fire_speed 0 causes bugs even on vanilla, so we use hook_fire_speed 1 instead + Msg.AddInt(1); + } + else if((i==31 || i==32) // collision and hooking + && m_apPlayers[ClientID]->GetCharacter()->NeededFaketuning() & FAKETUNE_SOLO) + { + Msg.AddInt(0); // send fake tunings selected above to the clients that they think they cant move + } + else + { + Msg.AddInt(pParams[i]); } } else