From: Mario Date: Wed, 7 Aug 2024 03:38:34 +0000 (+1000) Subject: Apply damage to nearby entities via a radial check, fixes applying through walls X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d8165f8a1c40bea757a5c783e778813f6b20e1d9;p=xonotic%2Fxonotic-data.pk3dir.git Apply damage to nearby entities via a radial check, fixes applying through walls --- diff --git a/qcsrc/server/damage.qc b/qcsrc/server/damage.qc index d5a9a20c7..0e8ec0746 100644 --- a/qcsrc/server/damage.qc +++ b/qcsrc/server/damage.qc @@ -1259,17 +1259,18 @@ void Fire_ApplyDamage(entity e) } e.fire_hitsound = true; - if(!IS_INDEPENDENT_PLAYER(e) && !STAT(FROZEN, e)) + if(IS_INDEPENDENT_PLAYER(e) || STAT(FROZEN, e)) + return; + + for(entity head = WarpZone_FindRadius(0.5 * (e.absmin + e.absmax), 0.5 * vlen(e.absmin - e.absmax), true); head; head = head.chain) { - IL_EACH(g_damagedbycontents, it.damagedbycontents && it != e, - { - if(!IS_DEAD(it) && it.takedamage && !IS_INDEPENDENT_PLAYER(it)) - if(boxesoverlap(e.absmin, e.absmax, it.absmin, it.absmax)) - { - t = autocvar_g_balance_firetransfer_time * (fireendtime - time); - d = autocvar_g_balance_firetransfer_damage * e.fire_damagepersec * t; - Fire_AddDamage(it, o, d, t, DEATH_FIRE.m_id); - } - }); + if(head == e || (IS_PLAYER(head) && SAME_TEAM(head, e))) continue; + if(IS_DEAD(head) || STAT(FROZEN, head)) continue; + if(IS_INDEPENDENT_PLAYER(head)) continue; + if(head.takedamage != DAMAGE_AIM) continue; + + t = autocvar_g_balance_firetransfer_time * (fireendtime - time); + d = autocvar_g_balance_firetransfer_damage * e.fire_damagepersec * t; + Fire_AddDamage(head, o, d, t, DEATH_FIRE.m_id); } }