mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Add server options for sv_teleport_hook and sv_teleport_weapons
This commit is contained in:
parent
6fb11efa40
commit
1b68bf65f2
|
@ -245,10 +245,10 @@ void CCharacterCore::Tick(bool UseInput)
|
|||
bool GoingThroughTele = false;
|
||||
int teleNr = 0;
|
||||
int Hit;
|
||||
if (m_NewHook)
|
||||
Hit = m_pCollision->IntersectLine(m_HookPos, NewPos, &NewPos, 0, true);
|
||||
else
|
||||
Hit = m_pCollision->IntersectLineTele(m_HookPos, NewPos, &NewPos, 0, &teleNr, true);
|
||||
if (m_NewHook || !g_Config.m_SvTeleportHook)
|
||||
Hit = m_pCollision->IntersectLine(m_HookPos, NewPos, &NewPos, 0, true);
|
||||
else
|
||||
Hit = m_pCollision->IntersectLineTele(m_HookPos, NewPos, &NewPos, 0, &teleNr, true);
|
||||
|
||||
//m_NewHook = false;
|
||||
|
||||
|
@ -257,9 +257,7 @@ void CCharacterCore::Tick(bool UseInput)
|
|||
if(Hit&CCollision::COLFLAG_NOHOOK)
|
||||
GoingToRetract = true;
|
||||
else if (Hit&CCollision::COLFLAG_TELE)
|
||||
{
|
||||
GoingThroughTele = true;
|
||||
}
|
||||
else
|
||||
GoingToHitGround = true;
|
||||
m_pReset = true;
|
||||
|
@ -305,8 +303,8 @@ void CCharacterCore::Tick(bool UseInput)
|
|||
|
||||
if(GoingThroughTele)
|
||||
{
|
||||
m_TriggeredEvents = 0;
|
||||
m_HookedPlayer = -1;
|
||||
m_TriggeredEvents = 0;
|
||||
m_HookedPlayer = -1;
|
||||
|
||||
m_NewHook = true;
|
||||
int Num = m_pTeleOuts[teleNr-1].size();
|
||||
|
|
|
@ -88,7 +88,10 @@ void CLaser::DoBounce()
|
|||
|
||||
vec2 To = m_Pos + m_Dir * m_Energy;
|
||||
|
||||
Res = GameServer()->Collision()->IntersectLineTele(m_Pos, To, &Coltile, &To, &z, false);
|
||||
if (g_Config.m_SvTeleportWeapons)
|
||||
Res = GameServer()->Collision()->IntersectLineTele(m_Pos, To, &Coltile, &To, &z, false);
|
||||
else
|
||||
Res = GameServer()->Collision()->IntersectLine(m_Pos, To, &Coltile, &To, false);
|
||||
|
||||
if(Res)
|
||||
{
|
||||
|
@ -117,7 +120,7 @@ void CLaser::DoBounce()
|
|||
|
||||
m_Energy -= distance(m_From, m_Pos) + GameServer()->Tuning()->m_LaserBounceCost;
|
||||
|
||||
if (Res&CCollision::COLFLAG_TELE)
|
||||
if (g_Config.m_SvTeleportWeapons && Res&CCollision::COLFLAG_TELE)
|
||||
{
|
||||
int Num = ((CGameControllerDDRace*)GameServer()->m_pController)->m_TeleOuts[z-1].size();
|
||||
m_TelePos = ((CGameControllerDDRace*)GameServer()->m_pController)->m_TeleOuts[z-1][(!Num)?Num:rand() % Num];
|
||||
|
|
|
@ -160,7 +160,7 @@ void CProjectile::Tick()
|
|||
|
||||
int x = GameServer()->Collision()->GetIndex(PrevPos, CurPos);
|
||||
int z = GameServer()->Collision()->IsTeleport(x);
|
||||
if (z)
|
||||
if (g_Config.m_SvTeleportWeapons && z)
|
||||
{
|
||||
int Num = ((CGameControllerDDRace*)GameServer()->m_pController)->m_TeleOuts[z-1].size();
|
||||
m_Pos = ((CGameControllerDDRace*)GameServer()->m_pController)->m_TeleOuts[z-1][(!Num)?Num:rand() % Num];
|
||||
|
|
|
@ -82,6 +82,8 @@ MACRO_CONFIG_INT(SvVoteSpectateRejoindelay, sv_vote_spectate_rejoindelay, 3, 0,
|
|||
MACRO_CONFIG_INT(SvVoteKick, sv_vote_kick, 1, 0, 1, CFGFLAG_SERVER, "Allow voting to kick players")
|
||||
MACRO_CONFIG_INT(SvVoteKickMin, sv_vote_kick_min, 0, 0, MAX_CLIENTS, CFGFLAG_SERVER, "Minimum number of players required to start a kick vote")
|
||||
MACRO_CONFIG_INT(SvVoteKickBantime, sv_vote_kick_bantime, 5, 0, 1440, CFGFLAG_SERVER, "The time to ban a player if kicked by vote. 0 makes it just use kick")
|
||||
MACRO_CONFIG_INT(SvTeleportWeapons, sv_teleport_weapons, 1, 0, 1, CFGFLAG_SERVER, "Teleporting of all weapons");
|
||||
MACRO_CONFIG_INT(SvTeleportHook, sv_teleport_hook, 1, 0, 1, CFGFLAG_SERVER, "Hook through teleporter");
|
||||
|
||||
// debug
|
||||
#ifdef CONF_DEBUG // this one can crash the server if not used correctly
|
||||
|
|
Loading…
Reference in a new issue