mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
do not release the hooks if you swap
This commit is contained in:
parent
2e12082938
commit
0ea811f70e
|
@ -2367,3 +2367,8 @@ int64_t CCharacter::TeamMask()
|
|||
{
|
||||
return Teams()->TeamMask(Team(), -1, GetPlayer()->GetCID());
|
||||
}
|
||||
|
||||
void CCharacter::SwapClients(int Client1, int Client2)
|
||||
{
|
||||
m_Core.m_HookedPlayer = m_Core.m_HookedPlayer == Client1 ? Client2 : m_Core.m_HookedPlayer == Client2 ? Client1 : m_Core.m_HookedPlayer;
|
||||
}
|
|
@ -40,6 +40,7 @@ public:
|
|||
virtual void TickDefered();
|
||||
virtual void TickPaused();
|
||||
virtual void Snap(int SnappingClient);
|
||||
virtual void SwapClients(int Client1, int Client2) override;
|
||||
|
||||
bool CanSnapCharacter(int SnappingClient);
|
||||
|
||||
|
|
|
@ -872,14 +872,6 @@ void CGameTeams::SwapTeamCharacters(CPlayer *pPlayer, CPlayer *pTargetPlayer, in
|
|||
return;
|
||||
}
|
||||
|
||||
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||
{
|
||||
if(m_Core.Team(i) == Team && GameServer()->m_apPlayers[i])
|
||||
{
|
||||
GameServer()->m_apPlayers[i]->GetCharacter()->ResetHook();
|
||||
GameServer()->m_World.ReleaseHooked(i);
|
||||
}
|
||||
}
|
||||
|
||||
CSaveTee PrimarySavedTee;
|
||||
PrimarySavedTee.Save(pPlayer->GetCharacter());
|
||||
|
|
Loading…
Reference in a new issue