From: Mario Date: Sat, 27 Jul 2019 03:20:20 +0000 (+1000) Subject: Allow any melee weapon to slap nades X-Git-Tag: xonotic-v0.8.5~1446 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e38329eda37a79530adf90f58929c4a9c914b78f;p=xonotic%2Fxonotic-data.pk3dir.git Allow any melee weapon to slap nades --- diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 484aaddcd..00ec43523 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -891,15 +891,18 @@ void nade_damage(entity this, entity inflictor, entity attacker, float damage, i damage = this.max_health * 0.1; else if(DEATH_ISWEAPON(deathtype, WEP_SHOCKWAVE) || DEATH_ISWEAPON(deathtype, WEP_SHOTGUN)) // WEAPONTODO { - if(deathtype & HITTYPE_SECONDARY) - { - damage = this.max_health * 0.1; - force *= 10; - } - else + if(!(deathtype & HITTYPE_SECONDARY)) damage = this.max_health * 1.15; } + // melee slaps + entity death_weapon = DEATH_WEAPONOF(deathtype); + if(((deathtype & HITTYPE_SECONDARY) ? (death_weapon.spawnflags & WEP_TYPE_MELEE_SEC) : (death_weapon.spawnflags & WEP_TYPE_MELEE_PRI))) + { + damage = this.max_health * 0.1; + force *= 10; + } + this.velocity += force; UpdateCSQCProjectile(this); @@ -1444,7 +1447,8 @@ MUTATOR_HOOKFUNCTION(nades, PlayerDies, CBC_ORDER_LAST) if(IS_PLAYER(frag_attacker)) { - float killcount_bonus = ((CS(frag_attacker).killcount >= 1) ? bound(0, autocvar_g_nades_bonus_score_minor * CS(frag_attacker).killcount, autocvar_g_nades_bonus_score_medium) : autocvar_g_nades_bonus_score_minor); + float killcount_bonus = ((CS(frag_attacker).killcount >= 1) ? bound(0, autocvar_g_nades_bonus_score_minor * CS(frag_attacker).killcount, autocvar_g_nades_bonus_score_medium) + : autocvar_g_nades_bonus_score_minor); if (SAME_TEAM(frag_attacker, frag_target) || frag_attacker == frag_target) nades_RemoveBonus(frag_attacker);