Fix some +showhookcoll

This commit is contained in:
def 2014-02-08 21:55:08 +01:00
parent 182c5aefc9
commit bf658945a5

View file

@ -1286,6 +1286,9 @@ int CGameClient::IntersectCharacter(vec2 HookPos, vec2 NewPos, vec2& NewPos2, in
float Distance = 0.0f; float Distance = 0.0f;
int ClosestID = -1; int ClosestID = -1;
if (!m_Tuning.m_PlayerHooking)
return ClosestID;
for (int i=0; i<MAX_CLIENTS; i++) for (int i=0; i<MAX_CLIENTS; i++)
{ {
CClientData cData = m_aClients[i]; CClientData cData = m_aClients[i];
@ -1294,7 +1297,7 @@ int CGameClient::IntersectCharacter(vec2 HookPos, vec2 NewPos, vec2& NewPos2, in
vec2 Position = mix(vec2(Prev.m_X, Prev.m_Y), vec2(Player.m_X, Player.m_Y), Client()->IntraGameTick()); vec2 Position = mix(vec2(Prev.m_X, Prev.m_Y), vec2(Player.m_X, Player.m_Y), Client()->IntraGameTick());
if (!cData.m_Active || cData.m_Team == TEAM_SPECTATORS || i == ownID || !m_Teams.CanCollide(i, ownID) || !m_PredictedChar.m_Collision) if (!cData.m_Active || cData.m_Team == TEAM_SPECTATORS || i == ownID || !m_Teams.SameTeam(i, ownID))
continue; continue;
vec2 ClosestPoint = closest_point_on_line(HookPos, NewPos, Position); vec2 ClosestPoint = closest_point_on_line(HookPos, NewPos, Position);