Kept hook when needed

This commit is contained in:
Kyle Bradley 2021-04-10 17:29:20 +02:00
parent b1c4148e9c
commit b4a5956f72
2 changed files with 5 additions and 1 deletions

View file

@ -742,7 +742,6 @@ void CCharacter::ResetHook()
m_Core.m_HookedPlayer = -1;
m_Core.m_HookState = HOOK_RETRACTED;
m_Core.m_TriggeredEvents |= COREEVENT_HOOK_RETRACT;
GameWorld()->ReleaseHooked(GetPlayer()->GetCID());
m_Core.m_HookPos = m_Core.m_Pos;
}
@ -1915,6 +1914,7 @@ void CCharacter::HandleTiles(int Index)
if(!g_Config.m_SvTeleportHoldHook)
{
ResetHook();
GameWorld()->ReleaseHooked(GetPlayer()->GetCID());
}
if(g_Config.m_SvTeleportLoseWeapons)
{
@ -1939,6 +1939,7 @@ void CCharacter::HandleTiles(int Index)
if(!g_Config.m_SvTeleportHoldHook)
{
ResetHook();
GameWorld()->ReleaseHooked(GetPlayer()->GetCID());
}
return;
@ -1954,6 +1955,7 @@ void CCharacter::HandleTiles(int Index)
if(!g_Config.m_SvTeleportHoldHook)
{
ResetHook();
GameWorld()->ReleaseHooked(GetPlayer()->GetCID());
}
}
return;
@ -2264,6 +2266,7 @@ void CCharacter::Pause(bool Pause)
if(m_Core.m_HookedPlayer != -1) // Keeping hook would allow cheats
{
ResetHook();
GameWorld()->ReleaseHooked(GetPlayer()->GetCID());
}
}
else

View file

@ -751,6 +751,7 @@ void CGameTeams::SwapTeamCharacters(CPlayer *pPlayer, CPlayer *pTargetPlayer, in
if(m_Core.Team(i) == Team && GameServer()->m_apPlayers[i])
{
GameServer()->m_apPlayers[i]->GetCharacter()->ResetHook();
GameServer()->m_World.ReleaseHooked(i);
}
}