mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Iterate over m_AttachedPlayers instead of MAX_CLIENTS
This commit is contained in:
parent
f07d773492
commit
5175734432
|
@ -7,8 +7,8 @@
|
|||
#include <base/system.h>
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#include "collision.h"
|
||||
#include <engine/shared/protocol.h>
|
||||
|
|
|
@ -1202,9 +1202,9 @@ void CCharacter::Snap(int SnappingClient)
|
|||
bool AttachedHookInView = false;
|
||||
if(PlayerAndHookNotInView)
|
||||
{
|
||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||
for(const auto &AttachedPlayerID : m_Core.m_AttachedPlayers)
|
||||
{
|
||||
CCharacter *OtherPlayer = GameServer()->GetPlayerChar(i);
|
||||
CCharacter *OtherPlayer = GameServer()->GetPlayerChar(AttachedPlayerID);
|
||||
if(OtherPlayer && OtherPlayer->m_Core.m_HookedPlayer == ID)
|
||||
{
|
||||
if(!NetworkClippedLine(SnappingClient, m_Pos, OtherPlayer->m_Pos))
|
||||
|
|
Loading…
Reference in a new issue