mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 09:38:19 +00:00
Merge pull request #8745 from ChillerDragon/pr_07_hook_coll
Fix hook coll on vanilla 0.7 servers
This commit is contained in:
commit
f057898ce0
|
@ -217,6 +217,7 @@ public:
|
||||||
|
|
||||||
// server info
|
// server info
|
||||||
virtual void GetServerInfo(class CServerInfo *pServerInfo) const = 0;
|
virtual void GetServerInfo(class CServerInfo *pServerInfo) const = 0;
|
||||||
|
virtual bool ServerCapAnyPlayerFlag() const = 0;
|
||||||
|
|
||||||
virtual int GetPredictionTime() = 0;
|
virtual int GetPredictionTime() = 0;
|
||||||
|
|
||||||
|
|
|
@ -1392,7 +1392,7 @@ void CClient::ProcessServerInfo(int RawType, NETADDR *pFrom, const void *pData,
|
||||||
#undef GET_INT
|
#undef GET_INT
|
||||||
}
|
}
|
||||||
|
|
||||||
static CServerCapabilities GetServerCapabilities(int Version, int Flags)
|
static CServerCapabilities GetServerCapabilities(int Version, int Flags, bool Sixup)
|
||||||
{
|
{
|
||||||
CServerCapabilities Result;
|
CServerCapabilities Result;
|
||||||
bool DDNet = false;
|
bool DDNet = false;
|
||||||
|
@ -1401,7 +1401,7 @@ static CServerCapabilities GetServerCapabilities(int Version, int Flags)
|
||||||
DDNet = Flags & SERVERCAPFLAG_DDNET;
|
DDNet = Flags & SERVERCAPFLAG_DDNET;
|
||||||
}
|
}
|
||||||
Result.m_ChatTimeoutCode = DDNet;
|
Result.m_ChatTimeoutCode = DDNet;
|
||||||
Result.m_AnyPlayerFlag = DDNet;
|
Result.m_AnyPlayerFlag = !Sixup;
|
||||||
Result.m_PingEx = false;
|
Result.m_PingEx = false;
|
||||||
Result.m_AllowDummy = true;
|
Result.m_AllowDummy = true;
|
||||||
Result.m_SyncWeaponInput = false;
|
Result.m_SyncWeaponInput = false;
|
||||||
|
@ -1502,7 +1502,7 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_ServerCapabilities = GetServerCapabilities(Version, Flags);
|
m_ServerCapabilities = GetServerCapabilities(Version, Flags, IsSixup());
|
||||||
m_CanReceiveServerCapabilities = false;
|
m_CanReceiveServerCapabilities = false;
|
||||||
m_ServerSentCapabilities = true;
|
m_ServerSentCapabilities = true;
|
||||||
}
|
}
|
||||||
|
@ -1510,7 +1510,7 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy)
|
||||||
{
|
{
|
||||||
if(m_CanReceiveServerCapabilities)
|
if(m_CanReceiveServerCapabilities)
|
||||||
{
|
{
|
||||||
m_ServerCapabilities = GetServerCapabilities(0, 0);
|
m_ServerCapabilities = GetServerCapabilities(0, 0, IsSixup());
|
||||||
m_CanReceiveServerCapabilities = false;
|
m_CanReceiveServerCapabilities = false;
|
||||||
}
|
}
|
||||||
bool MapDetailsWerePresent = m_MapDetailsPresent;
|
bool MapDetailsWerePresent = m_MapDetailsPresent;
|
||||||
|
|
|
@ -208,6 +208,8 @@ class CClient : public IClient, public CDemoPlayer::IListener
|
||||||
bool m_ServerSentCapabilities = false;
|
bool m_ServerSentCapabilities = false;
|
||||||
CServerCapabilities m_ServerCapabilities;
|
CServerCapabilities m_ServerCapabilities;
|
||||||
|
|
||||||
|
bool ServerCapAnyPlayerFlag() const override { return m_ServerCapabilities.m_AnyPlayerFlag; }
|
||||||
|
|
||||||
CServerInfo m_CurrentServerInfo;
|
CServerInfo m_CurrentServerInfo;
|
||||||
int64_t m_CurrentServerInfoRequestTime = -1; // >= 0 should request, == -1 got info
|
int64_t m_CurrentServerInfoRequestTime = -1; // >= 0 should request, == -1 got info
|
||||||
|
|
||||||
|
|
|
@ -191,7 +191,7 @@ int CControls::SnapInput(int *pData)
|
||||||
if(m_pClient->m_Scoreboard.Active())
|
if(m_pClient->m_Scoreboard.Active())
|
||||||
m_aInputData[g_Config.m_ClDummy].m_PlayerFlags |= PLAYERFLAG_SCOREBOARD;
|
m_aInputData[g_Config.m_ClDummy].m_PlayerFlags |= PLAYERFLAG_SCOREBOARD;
|
||||||
|
|
||||||
if(m_pClient->m_Controls.m_aShowHookColl[g_Config.m_ClDummy])
|
if(m_pClient->m_Controls.m_aShowHookColl[g_Config.m_ClDummy] && Client()->ServerCapAnyPlayerFlag())
|
||||||
m_aInputData[g_Config.m_ClDummy].m_PlayerFlags |= PLAYERFLAG_AIM;
|
m_aInputData[g_Config.m_ClDummy].m_PlayerFlags |= PLAYERFLAG_AIM;
|
||||||
|
|
||||||
bool Send = m_aLastData[g_Config.m_ClDummy].m_PlayerFlags != m_aInputData[g_Config.m_ClDummy].m_PlayerFlags;
|
bool Send = m_aLastData[g_Config.m_ClDummy].m_PlayerFlags != m_aInputData[g_Config.m_ClDummy].m_PlayerFlags;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
||||||
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
||||||
|
|
||||||
|
#include <engine/client/enums.h>
|
||||||
#include <engine/demo.h>
|
#include <engine/demo.h>
|
||||||
#include <engine/graphics.h>
|
#include <engine/graphics.h>
|
||||||
#include <engine/shared/config.h>
|
#include <engine/shared/config.h>
|
||||||
|
@ -203,8 +204,21 @@ void CPlayers::RenderHookCollLine(
|
||||||
Position = mix(vec2(Prev.m_X, Prev.m_Y), vec2(Player.m_X, Player.m_Y), IntraTick);
|
Position = mix(vec2(Prev.m_X, Prev.m_Y), vec2(Player.m_X, Player.m_Y), IntraTick);
|
||||||
// draw hook collision line
|
// draw hook collision line
|
||||||
{
|
{
|
||||||
|
bool Aim = (Player.m_PlayerFlags & PLAYERFLAG_AIM);
|
||||||
|
if(!Client()->ServerCapAnyPlayerFlag())
|
||||||
|
{
|
||||||
|
for(int i = 0; i < NUM_DUMMIES; i++)
|
||||||
|
{
|
||||||
|
if(ClientId == m_pClient->m_aLocalIds[i])
|
||||||
|
{
|
||||||
|
Aim = GameClient()->m_Controls.m_aShowHookColl[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool AlwaysRenderHookColl = GameClient()->m_GameInfo.m_AllowHookColl && (Local ? g_Config.m_ClShowHookCollOwn : g_Config.m_ClShowHookCollOther) == 2;
|
bool AlwaysRenderHookColl = GameClient()->m_GameInfo.m_AllowHookColl && (Local ? g_Config.m_ClShowHookCollOwn : g_Config.m_ClShowHookCollOther) == 2;
|
||||||
bool RenderHookCollPlayer = ClientId >= 0 && Player.m_PlayerFlags & PLAYERFLAG_AIM && (Local ? g_Config.m_ClShowHookCollOwn : g_Config.m_ClShowHookCollOther) > 0;
|
bool RenderHookCollPlayer = ClientId >= 0 && Aim && (Local ? g_Config.m_ClShowHookCollOwn : g_Config.m_ClShowHookCollOther) > 0;
|
||||||
if(Local && GameClient()->m_GameInfo.m_AllowHookColl && Client()->State() != IClient::STATE_DEMOPLAYBACK)
|
if(Local && GameClient()->m_GameInfo.m_AllowHookColl && Client()->State() != IClient::STATE_DEMOPLAYBACK)
|
||||||
RenderHookCollPlayer = GameClient()->m_Controls.m_aShowHookColl[g_Config.m_ClDummy] && g_Config.m_ClShowHookCollOwn > 0;
|
RenderHookCollPlayer = GameClient()->m_Controls.m_aShowHookColl[g_Config.m_ClDummy] && g_Config.m_ClShowHookCollOwn > 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue