Add sv_check_teleport_hold_hook map setting

This commit is contained in:
Tim Schumacher 2017-06-15 15:49:07 +02:00
parent 2365958227
commit 47fecc8659
3 changed files with 38 additions and 18 deletions

View file

@ -1880,14 +1880,19 @@ void CCharacter::HandleTiles(int Index)
{
if(Controller->m_TeleCheckOuts[k].size())
{
m_Core.m_HookedPlayer = -1;
m_Core.m_HookState = HOOK_RETRACTED;
m_Core.m_TriggeredEvents |= COREEVENT_HOOK_RETRACT;
int Num = Controller->m_TeleCheckOuts[k].size();
m_Core.m_Pos = Controller->m_TeleCheckOuts[k][(!Num)?Num:rand() % Num];
GameWorld()->ReleaseHooked(GetPlayer()->GetCID());
m_Core.m_Vel = vec2(0,0);
m_Core.m_HookPos = m_Core.m_Pos;
if(!g_Config.m_SvCheckTeleportHoldHook)
{
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;
}
return;
}
}
@ -1895,13 +1900,17 @@ void CCharacter::HandleTiles(int Index)
vec2 SpawnPos;
if(GameServer()->m_pController->CanSpawn(m_pPlayer->GetTeam(), &SpawnPos))
{
m_Core.m_HookedPlayer = -1;
m_Core.m_HookState = HOOK_RETRACTED;
m_Core.m_TriggeredEvents |= COREEVENT_HOOK_RETRACT;
m_Core.m_Pos = SpawnPos;
GameWorld()->ReleaseHooked(GetPlayer()->GetCID());
m_Core.m_Vel = vec2(0,0);
m_Core.m_HookPos = m_Core.m_Pos;
if(!g_Config.m_SvCheckTeleportHoldHook)
{
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;
}
}
return;
}
@ -1914,12 +1923,17 @@ void CCharacter::HandleTiles(int Index)
{
if(Controller->m_TeleCheckOuts[k].size())
{
m_Core.m_HookedPlayer = -1;
m_Core.m_HookState = HOOK_RETRACTED;
m_Core.m_TriggeredEvents |= COREEVENT_HOOK_RETRACT;
int Num = Controller->m_TeleCheckOuts[k].size();
m_Core.m_Pos = Controller->m_TeleCheckOuts[k][(!Num)?Num:rand() % Num];
m_Core.m_HookPos = m_Core.m_Pos;
if(!g_Config.m_SvCheckTeleportHoldHook)
{
m_Core.m_HookedPlayer = -1;
m_Core.m_HookState = HOOK_RETRACTED;
m_Core.m_TriggeredEvents |= COREEVENT_HOOK_RETRACT;
m_Core.m_HookPos = m_Core.m_Pos;
}
return;
}
}
@ -1927,11 +1941,15 @@ void CCharacter::HandleTiles(int Index)
vec2 SpawnPos;
if(GameServer()->m_pController->CanSpawn(m_pPlayer->GetTeam(), &SpawnPos))
{
m_Core.m_HookedPlayer = -1;
m_Core.m_HookState = HOOK_RETRACTED;
m_Core.m_TriggeredEvents |= COREEVENT_HOOK_RETRACT;
m_Core.m_Pos = SpawnPos;
m_Core.m_HookPos = m_Core.m_Pos;
if(!g_Config.m_SvCheckTeleportHoldHook)
{
m_Core.m_HookedPlayer = -1;
m_Core.m_HookState = HOOK_RETRACTED;
m_Core.m_TriggeredEvents |= COREEVENT_HOOK_RETRACT;
m_Core.m_HookPos = m_Core.m_Pos;
}
}
return;
}

View file

@ -2480,6 +2480,7 @@ void CGameContext::OnInit(/*class IKernel *pKernel*/)
g_Config.m_SvOldTeleportHook = 0;
g_Config.m_SvOldTeleportWeapons = 0;
g_Config.m_SvTeleportHoldHook = 0;
g_Config.m_SvCheckTeleportHoldHook = 0;
g_Config.m_SvTeam = 1;
g_Config.m_SvShowOthersDefault = 0;

View file

@ -153,6 +153,7 @@ MACRO_CONFIG_INT(SvJoinVoteDelay, sv_join_vote_delay, 60, 0, 1000, CFGFLAG_SERVE
MACRO_CONFIG_INT(SvOldTeleportWeapons, sv_old_teleport_weapons, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Teleporting of all weapons (deprecated, use special entities instead)");
MACRO_CONFIG_INT(SvOldTeleportHook, sv_old_teleport_hook, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Hook through teleporter (deprecated, use special entities instead)");
MACRO_CONFIG_INT(SvTeleportHoldHook, sv_teleport_hold_hook, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Hold hook when teleported");
MACRO_CONFIG_INT(SvCheckTeleportHoldHook, sv_check_teleport_hold_hook, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Hold hook when teleported by checkpoint tele");
MACRO_CONFIG_INT(SvTeleportLoseWeapons, sv_teleport_lose_weapons, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Lose weapons when teleported (useful for some race maps)");
MACRO_CONFIG_INT(SvDeepfly, sv_deepfly, 1, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Allow fire non auto weapons when deep");