diff --git a/src/game/server/entities/laser.cpp b/src/game/server/entities/laser.cpp index bdea796ea..142013371 100644 --- a/src/game/server/entities/laser.cpp +++ b/src/game/server/entities/laser.cpp @@ -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())) diff --git a/src/game/server/entities/laser.h b/src/game/server/entities/laser.h index fcb53effa..eafead090 100644 --- a/src/game/server/entities/laser.h +++ b/src/game/server/entities/laser.h @@ -38,6 +38,7 @@ private: int m_TuneZone; bool m_TeleportCancelled; bool m_IsBlueTeleport; + bool m_BelongsToPracticeTeam; }; #endif diff --git a/src/game/server/entities/projectile.cpp b/src/game/server/entities/projectile.cpp index 8bcf70c86..49ee3d05b 100644 --- a/src/game/server/entities/projectile.cpp +++ b/src/game/server/entities/projectile.cpp @@ -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; diff --git a/src/game/server/entities/projectile.h b/src/game/server/entities/projectile.h index c866eadea..397e79642 100644 --- a/src/game/server/entities/projectile.h +++ b/src/game/server/entities/projectile.h @@ -47,6 +47,7 @@ private: int m_Bouncing; bool m_Freeze; int m_TuneZone; + bool m_BelongsToPracticeTeam; public: void SetBouncing(int Value);