mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Always destroy bullets/lasers on kill when in practice team (fixes #4694)
to prevent /teleporting back to start line and cheating
This commit is contained in:
parent
80df1aefea
commit
3650281cf0
|
@ -25,7 +25,10 @@ CLaser::CLaser(CGameWorld *pGameWorld, vec2 Pos, vec2 Direction, float StartEner
|
|||
m_TeleportCancelled = false;
|
||||
m_IsBlueTeleport = false;
|
||||
m_TuneZone = GameServer()->Collision()->IsTune(GameServer()->Collision()->GetMapIndex(m_Pos));
|
||||
m_TeamMask = GameServer()->GetPlayerChar(Owner) ? GameServer()->GetPlayerChar(Owner)->Teams()->TeamMask(GameServer()->GetPlayerChar(Owner)->Team(), -1, m_Owner) : 0;
|
||||
CCharacter *pOwnerChar = GameServer()->GetPlayerChar(m_Owner);
|
||||
m_TeamMask = pOwnerChar ? pOwnerChar->Teams()->TeamMask(pOwnerChar->Team(), -1, m_Owner) : 0;
|
||||
m_BelongsToPracticeTeam = pOwnerChar && pOwnerChar->Teams()->IsPractice(pOwnerChar->Team());
|
||||
|
||||
GameWorld()->InsertEntity(this);
|
||||
DoBounce();
|
||||
}
|
||||
|
@ -230,7 +233,7 @@ void CLaser::Reset()
|
|||
|
||||
void CLaser::Tick()
|
||||
{
|
||||
if(g_Config.m_SvDestroyLasersOnDeath && m_Owner >= 0)
|
||||
if((g_Config.m_SvDestroyLasersOnDeath || m_BelongsToPracticeTeam) && m_Owner >= 0)
|
||||
{
|
||||
CCharacter *pOwnerChar = GameServer()->GetPlayerChar(m_Owner);
|
||||
if(!(pOwnerChar && pOwnerChar->IsAlive()))
|
||||
|
|
|
@ -38,6 +38,7 @@ private:
|
|||
int m_TuneZone;
|
||||
bool m_TeleportCancelled;
|
||||
bool m_IsBlueTeleport;
|
||||
bool m_BelongsToPracticeTeam;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -44,6 +44,9 @@ CProjectile::CProjectile(
|
|||
|
||||
m_TuneZone = GameServer()->Collision()->IsTune(GameServer()->Collision()->GetMapIndex(m_Pos));
|
||||
|
||||
CCharacter *pOwnerChar = GameServer()->GetPlayerChar(m_Owner);
|
||||
m_BelongsToPracticeTeam = pOwnerChar && pOwnerChar->Teams()->IsPractice(pOwnerChar->Team());
|
||||
|
||||
GameWorld()->InsertEntity(this);
|
||||
}
|
||||
|
||||
|
@ -142,7 +145,7 @@ void CProjectile::Tick()
|
|||
{
|
||||
TeamMask = pOwnerChar->Teams()->TeamMask(pOwnerChar->Team(), -1, m_Owner);
|
||||
}
|
||||
else if(m_Owner >= 0 && (m_Type != WEAPON_GRENADE || g_Config.m_SvDestroyBulletsOnDeath))
|
||||
else if(m_Owner >= 0 && (m_Type != WEAPON_GRENADE || g_Config.m_SvDestroyBulletsOnDeath || m_BelongsToPracticeTeam))
|
||||
{
|
||||
m_MarkedForDestroy = true;
|
||||
return;
|
||||
|
|
|
@ -47,6 +47,7 @@ private:
|
|||
int m_Bouncing;
|
||||
bool m_Freeze;
|
||||
int m_TuneZone;
|
||||
bool m_BelongsToPracticeTeam;
|
||||
|
||||
public:
|
||||
void SetBouncing(int Value);
|
||||
|
|
Loading…
Reference in a new issue