From 09c28026757f6e2c78f826ba90a5bac907706e48 Mon Sep 17 00:00:00 2001 From: blubs Date: Sun, 15 Jan 2023 14:39:42 -0800 Subject: [PATCH] SERVER Add fix for raygun runaway loop --- source/server/damage.qc | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/source/server/damage.qc b/source/server/damage.qc index 0e5082d..3968549 100644 --- a/source/server/damage.qc +++ b/source/server/damage.qc @@ -560,8 +560,11 @@ void(entity inflictor, entity attacker, float damage2, float mindamage, float ra { final_damage = radius - vlen(inflictor.origin - ent.origin); - if(final_damage < 0) + if(final_damage < 0) + { + ent = ent.chain; continue; + } if (final_damage > radius * 0.6) final_damage = 100; @@ -587,8 +590,11 @@ void(entity inflictor, entity attacker, float damage2, float mindamage, float ra final_damage = radius - vlen(inflictor.origin - ent.origin); final_damage *= 4; - if (final_damage < 0) + if (final_damage < 0) + { + ent = ent.chain; continue; + } ent.health -= final_damage; @@ -607,7 +613,8 @@ void(entity inflictor, entity attacker, float damage2, float mindamage, float ra if (mapname == "ndu" && ent.classname == "ai_zombie" && inflictor.classname == "explosive_barrel") { ach_tracker_barr++; - if (ach_tracker_barr >= 15) { + if (ach_tracker_barr >= 15) + { GiveAchievement(13); } } @@ -620,10 +627,14 @@ void(entity inflictor, entity attacker, float damage2, float mindamage, float ra r --; } - if (mindamage == 75) + if (mindamage == 75) + { final_damage = (200 * multi) + 185; - else + } + else + { final_damage = (mindamage + damage2)/2; + } if (final_damage > 0) {