mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +00:00
Added command sv_dragger_range. Maybe need some more tests.
This commit is contained in:
parent
f20a6a4934
commit
c5443d8e34
|
@ -311,6 +311,7 @@ MACRO_CONFIG_INT(SvMaxAfkTime, sv_max_afk_time, 0, 0, 9999, CFGFLAG_SERVER, "The
|
||||||
MACRO_CONFIG_INT(SvMaxAfkVoteTime, sv_max_afk_vote_time, 300, 0, 9999, CFGFLAG_SERVER, "The time in seconds a player can be afk and his votes still count (0 = disabled)")
|
MACRO_CONFIG_INT(SvMaxAfkVoteTime, sv_max_afk_vote_time, 300, 0, 9999, CFGFLAG_SERVER, "The time in seconds a player can be afk and his votes still count (0 = disabled)")
|
||||||
MACRO_CONFIG_INT(SvPlasmaRange, sv_plasma_range, 700, 1, 99999, CFGFLAG_SERVER|CFGFLAG_GAME, "How far will the plasma gun track tees")
|
MACRO_CONFIG_INT(SvPlasmaRange, sv_plasma_range, 700, 1, 99999, CFGFLAG_SERVER|CFGFLAG_GAME, "How far will the plasma gun track tees")
|
||||||
MACRO_CONFIG_INT(SvPlasmaPerSec, sv_plasma_per_sec, 3, 0, 50, CFGFLAG_SERVER|CFGFLAG_GAME, "How many shots does the plasma gun fire per seconds")
|
MACRO_CONFIG_INT(SvPlasmaPerSec, sv_plasma_per_sec, 3, 0, 50, CFGFLAG_SERVER|CFGFLAG_GAME, "How many shots does the plasma gun fire per seconds")
|
||||||
|
MACRO_CONFIG_INT(SvDraggerRange, sv_dragger_range, 700, 1, 99999, CFGFLAG_SERVER|CFGFLAG_GAME, "How far will the dragger track tees")
|
||||||
MACRO_CONFIG_INT(SvVotePause, sv_vote_pause, 1, 0, 1, CFGFLAG_SERVER, "Allow voting to pause players (instead of moving to spectators)")
|
MACRO_CONFIG_INT(SvVotePause, sv_vote_pause, 1, 0, 1, CFGFLAG_SERVER, "Allow voting to pause players (instead of moving to spectators)")
|
||||||
MACRO_CONFIG_INT(SvVotePauseTime, sv_vote_pause_time, 10, 0, 360, CFGFLAG_SERVER, "The time (in seconds) players have to wait in pause when paused by vote")
|
MACRO_CONFIG_INT(SvVotePauseTime, sv_vote_pause_time, 10, 0, 360, CFGFLAG_SERVER, "The time (in seconds) players have to wait in pause when paused by vote")
|
||||||
MACRO_CONFIG_INT(SvTuneReset, sv_tune_reset, 1, 0, 1, CFGFLAG_SERVER, "Whether tuning is reset after each map change or not")
|
MACRO_CONFIG_INT(SvTuneReset, sv_tune_reset, 1, 0, 1, CFGFLAG_SERVER, "Whether tuning is reset after each map change or not")
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
/* (c) Shereef Marzouk. See "licence DDRace.txt" and the readme.txt in the root of the distribution for more information. */
|
/* (c) Shereef Marzouk. See "licence DDRace.txt" and the readme.txt in the root of the distribution for more information. */
|
||||||
#include <engine/config.h>
|
#include <engine/config.h>
|
||||||
#include <engine/server.h>
|
#include <engine/server.h>
|
||||||
|
#include <engine/shared/config.h>
|
||||||
#include <game/generated/protocol.h>
|
#include <game/generated/protocol.h>
|
||||||
#include <game/server/gamecontext.h>
|
#include <game/server/gamecontext.h>
|
||||||
#include <game/server/teams.h>
|
#include <game/server/teams.h>
|
||||||
#include <game/server/gamemodes/DDRace.h>
|
#include <game/server/gamemodes/DDRace.h>
|
||||||
#include "dragger.h"
|
#include "dragger.h"
|
||||||
|
|
||||||
const int LENGTH = 700;
|
//const int LENGTH = 700;
|
||||||
|
|
||||||
CDragger::CDragger(CGameWorld *pGameWorld, vec2 Pos, float Strength, bool NW,
|
CDragger::CDragger(CGameWorld *pGameWorld, vec2 Pos, float Strength, bool NW,
|
||||||
int CatchedTeam, int Layer, int Number) :
|
int CatchedTeam, int Layer, int Number) :
|
||||||
|
@ -39,7 +40,7 @@ void CDragger::Move()
|
||||||
mem_zero(m_SoloEnts, sizeof(m_SoloEnts));
|
mem_zero(m_SoloEnts, sizeof(m_SoloEnts));
|
||||||
CCharacter *TempEnts[MAX_CLIENTS];
|
CCharacter *TempEnts[MAX_CLIENTS];
|
||||||
|
|
||||||
int Num = GameServer()->m_World.FindEntities(m_Pos, LENGTH,
|
int Num = GameServer()->m_World.FindEntities(m_Pos, g_Config.m_SvDraggerRange,
|
||||||
(CEntity**) m_SoloEnts, MAX_CLIENTS, CGameWorld::ENTTYPE_CHARACTER);
|
(CEntity**) m_SoloEnts, MAX_CLIENTS, CGameWorld::ENTTYPE_CHARACTER);
|
||||||
mem_copy(TempEnts, m_SoloEnts, sizeof(TempEnts));
|
mem_copy(TempEnts, m_SoloEnts, sizeof(TempEnts));
|
||||||
|
|
||||||
|
@ -118,7 +119,7 @@ void CDragger::Drag()
|
||||||
else
|
else
|
||||||
Res = GameServer()->Collision()->IntersectNoLaserNW(m_Pos,
|
Res = GameServer()->Collision()->IntersectNoLaserNW(m_Pos,
|
||||||
Target->m_Pos, 0, 0);
|
Target->m_Pos, 0, 0);
|
||||||
if (Res || length(m_Pos - Target->m_Pos) > 700)
|
if (Res || length(m_Pos - Target->m_Pos) > g_Config.m_SvDraggerRange)
|
||||||
{
|
{
|
||||||
Target = 0;
|
Target = 0;
|
||||||
if (i == -1)
|
if (i == -1)
|
||||||
|
|
Loading…
Reference in a new issue