diff --git a/src/game/server/entities/laser.cpp b/src/game/server/entities/laser.cpp index 2e6a2dae3..b4207605a 100644 --- a/src/game/server/entities/laser.cpp +++ b/src/game/server/entities/laser.cpp @@ -168,7 +168,7 @@ void CLaser::DoBounce() } CCharacter *pOwnerChar = GameServer()->GetPlayerChar(m_Owner); - if (m_Owner >= 0 && m_Energy <= 0 && m_Pos && !m_TeleportCancelled && pOwnerChar && + if (m_Owner >= 0 && m_Energy <= 0 && m_Pos && !m_TeleportCancelled && pOwnerChar && pOwnerChar->IsAlive() && pOwnerChar->m_HasTeleLaser && m_Type == WEAPON_RIFLE) { vec2 PossiblePos; @@ -238,6 +238,15 @@ void CLaser::Reset() void CLaser::Tick() { + if(g_Config.m_SvDestroyLasersOnDeath && m_Owner >= 0) + { + CCharacter *pOwnerChar = GameServer()->GetPlayerChar(m_Owner); + if(!(pOwnerChar && pOwnerChar->IsAlive())) + { + Reset(); + } + } + float Delay; if (m_TuneZone) Delay = GameServer()->TuningList()[m_TuneZone].m_LaserBounceDelay; diff --git a/src/game/server/entities/projectile.cpp b/src/game/server/entities/projectile.cpp index 7624f737a..a590aea9b 100644 --- a/src/game/server/entities/projectile.cpp +++ b/src/game/server/entities/projectile.cpp @@ -145,7 +145,7 @@ void CProjectile::Tick() { TeamMask = pOwnerChar->Teams()->TeamMask(pOwnerChar->Team(), -1, m_Owner); } - else if (m_Owner >= 0) + else if (m_Owner >= 0 && (m_Weapon != WEAPON_GRENADE || g_Config.m_SvDestroyBulletsOnDeath)) { GameServer()->m_World.DestroyEntity(this); return; diff --git a/src/game/variables.h b/src/game/variables.h index 85c65df83..9ed8f3702 100644 --- a/src/game/variables.h +++ b/src/game/variables.h @@ -146,6 +146,8 @@ MACRO_CONFIG_INT(SvOldTeleportHook, sv_old_teleport_hook, 0, 0, 1, CFGFLAG_SERVE MACRO_CONFIG_INT(SvTeleportHoldHook, sv_teleport_hold_hook, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Hold hook when teleported") 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") +MACRO_CONFIG_INT(SvDestroyBulletsOnDeath, sv_destroy_bullets_on_death, 1, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Destroy bullets when their owner dies") +MACRO_CONFIG_INT(SvDestroyLasersOnDeath, sv_destroy_lasers_on_death, 0, 0, 1, CFGFLAG_SERVER|CFGFLAG_GAME, "Destroy lasers when their owner dies") MACRO_CONFIG_INT(SvMapUpdateRate, sv_mapupdaterate, 5, 1, 100, CFGFLAG_SERVER, "64 player id <-> vanilla id players map update rate")