From d5713600bbaf050725c6bf7d38e2bd766548c503 Mon Sep 17 00:00:00 2001 From: "Mr. Nuke" <140557157+lionstrykes10911@users.noreply.github.com> Date: Fri, 14 Nov 2025 00:32:24 -0300 Subject: [PATCH 1/3] Gave physical projectiles radius limit a server convar --- lua/pac3/extra/shared/projectiles.lua | 29 +++++++++++++++------------ 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/lua/pac3/extra/shared/projectiles.lua b/lua/pac3/extra/shared/projectiles.lua index cfcf0f14b..d80d9db41 100644 --- a/lua/pac3/extra/shared/projectiles.lua +++ b/lua/pac3/extra/shared/projectiles.lua @@ -6,6 +6,7 @@ local pac_sv_projectile_max_speed = CreateConVar("pac_sv_projectile_max_speed", local pac_sv_projectile_max_damage = CreateConVar("pac_sv_projectile_max_damage", 100000, CLIENT and {FCVAR_REPLICATED} or {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "maximum damage for physical projectiles") local pac_sv_projectile_max_mass = CreateConVar("pac_sv_projectile_max_mass", 50000, CLIENT and {FCVAR_REPLICATED} or {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "maximum speed for physical projectiles") local pac_sv_projectile_allow_custom_collision_mesh = CreateConVar("pac_sv_projectile_allow_custom_collision_mesh", "1", CLIENT and {FCVAR_REPLICATED} or {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Whether to allow other models' collision mesh as a physical projectile, rather than just box and sphere") +local pac_sv_projectile_max_spawn_radius = CreateConVar("pac_sv_projectile_max_spawn_radius", 2000, CLIENT and {FCVAR_REPLICATED} or {FCVAR_ARCHIVE, FCVAR_REPLICATED}, "Whether to limit how far away physical projectiles should be able to spawn, set to 0 to disable this limit altogether.") do -- projectile entity local ENT = {} @@ -587,22 +588,24 @@ if SERVER then part.AttractRadius = net.ReadUInt(10) part.Bounce = net.ReadInt(15) / 100 - local radius_limit = 2000 + local radius_limit = pac_sv_projectile_max_spawn_radius:GetFloat() - if pos:Distance(ply:EyePos()) > radius_limit * ply:GetModelScale() then - local ok = false + if radius_limit > 0 then + if pos:Distance(ply:EyePos()) > radius_limit * ply:GetModelScale() then + local ok = false - for _, ent in ipairs(ents.FindInSphere(pos, radius_limit)) do - if (ent.CPPIGetOwner and ent:CPPIGetOwner() == ply) or ent.projectile_owner == ply or ent:GetOwner() == ply then - ok = true - break - end - end + for _, ent in ipairs(ents.FindInSphere(pos, radius_limit)) do + if (ent.CPPIGetOwner and ent:CPPIGetOwner() == ply) or ent.projectile_owner == ply or ent:GetOwner() == ply then + ok = true + break + end + end - if not ok then - pos = ply:EyePos() - end - end + if not ok then + pos = ply:EyePos() + end + end + end local function spawn() if not ply:IsValid() then return end From a64e747228c5d2abfa72222ef0d3e45534f9467c Mon Sep 17 00:00:00 2001 From: pingu7867 Date: Thu, 13 Nov 2025 22:57:07 -0500 Subject: [PATCH 2/3] Update projectiles.lua revert quad spaces to tabs --- lua/pac3/extra/shared/projectiles.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lua/pac3/extra/shared/projectiles.lua b/lua/pac3/extra/shared/projectiles.lua index d80d9db41..d8f4f906f 100644 --- a/lua/pac3/extra/shared/projectiles.lua +++ b/lua/pac3/extra/shared/projectiles.lua @@ -590,16 +590,16 @@ if SERVER then local radius_limit = pac_sv_projectile_max_spawn_radius:GetFloat() - if radius_limit > 0 then - if pos:Distance(ply:EyePos()) > radius_limit * ply:GetModelScale() then - local ok = false - - for _, ent in ipairs(ents.FindInSphere(pos, radius_limit)) do - if (ent.CPPIGetOwner and ent:CPPIGetOwner() == ply) or ent.projectile_owner == ply or ent:GetOwner() == ply then - ok = true - break - end - end + if radius_limit > 0 then + if pos:Distance(ply:EyePos()) > radius_limit * ply:GetModelScale() then + local ok = false + + for _, ent in ipairs(ents.FindInSphere(pos, radius_limit)) do + if (ent.CPPIGetOwner and ent:CPPIGetOwner() == ply) or ent.projectile_owner == ply or ent:GetOwner() == ply then + ok = true + break + end + end if not ok then pos = ply:EyePos() From 56e547802829cc8536c56535c4ce79e4d36de1ad Mon Sep 17 00:00:00 2001 From: "Mr. Nuke" <140557157+lionstrykes10911@users.noreply.github.com> Date: Tue, 28 Apr 2026 10:31:20 -0300 Subject: [PATCH 3/3] Update net_combat.lua set the proper damage type if DoNotKill or its reverse is on. --- lua/pac3/extra/shared/net_combat.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lua/pac3/extra/shared/net_combat.lua b/lua/pac3/extra/shared/net_combat.lua index 79fff09d8..29387da92 100644 --- a/lua/pac3/extra/shared/net_combat.lua +++ b/lua/pac3/extra/shared/net_combat.lua @@ -1169,6 +1169,7 @@ if SERVER then end dmg_info:SetDamagePosition(ent:NearestPoint(pos)) dmg_info:SetReportedPosition(pos) + dmg_info:SetDamageType(damage_types[tbl.DamageType]) ent:TakeDamageInfo(dmg_info) max_dmg = math.max(max_dmg, dmg_info:GetDamage()) end @@ -1181,6 +1182,7 @@ if SERVER then dmg_info2:SetReportedPosition(pos) dmg_info2:SetDamage( math.min(ent:Health() - tbl.CriticalHealth, tbl.Damage)) dmg_info2:IsBulletDamage(tbl.Bullet) + dmg_info2:SetDamageType(damage_types[tbl.DamageType]) dmg_info2:SetDamageForce(Vector(0,0,0)) if IsValid(attacker) then dmg_info2:SetAttacker(attacker) end