From 52b0619edb445ae894aedb129e9f1c4ab584f1a6 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 30 Jul 2024 21:50:32 +1000 Subject: [PATCH] Simplify time check and remove push force from combos over time --- qcsrc/common/weapons/weapon/electro.qc | 16 ++++++++-------- qcsrc/common/weapons/weapon/electro.qh | 1 - 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index 045c5cb9a..cb8ea617b 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -53,15 +53,16 @@ void W_Electro_TriggerCombo(vector org, float rad, entity own) void W_Electro_ExplodeComboThink(entity this) { - float dt = time - this.teleport_time + this.dmg_interval; + if(time - this.teleport_time > this.dmg_duration) + { + delete(this); + return; + } - RadiusDamage(this, this.realowner, this.dmg, this.dmg_edge, this.dmg_radius, NULL, NULL, this.dmg_force, this.projectiledeathtype, this.weaponentity_fld, NULL); - this.projectiledeathtype |= HITTYPE_BOUNCE; // ensure it doesn't spam its effect + this.nextthink = time + this.dmg_interval; - if(dt < this.dmg_duration) - this.nextthink = time + this.dmg_interval; // soon - else - delete(this); + RadiusDamage(this, this.realowner, this.dmg, this.dmg_edge, this.dmg_radius, NULL, NULL, 0, this.projectiledeathtype, this.weaponentity_fld, NULL); + this.projectiledeathtype |= HITTYPE_BOUNCE; // ensure it doesn't spam its effect } void W_Electro_ExplodeCombo(entity this) @@ -86,7 +87,6 @@ void W_Electro_ExplodeCombo(entity this) this.dmg = WEP_CVAR(electro, combo_damage) * this.dmg_interval; this.dmg_edge = WEP_CVAR(electro, combo_edgedamage) * this.dmg_interval; this.dmg_radius = WEP_CVAR(electro, combo_radius); - this.dmg_force = WEP_CVAR(electro, combo_force) * this.dmg_interval; this.dmg_duration = WEP_CVAR(electro, combo_duration); this.teleport_time = time; this.dmg_last = 1; diff --git a/qcsrc/common/weapons/weapon/electro.qh b/qcsrc/common/weapons/weapon/electro.qh index be3bcfb5e..f8e53ee75 100644 --- a/qcsrc/common/weapons/weapon/electro.qh +++ b/qcsrc/common/weapons/weapon/electro.qh @@ -83,7 +83,6 @@ SPAWNFUNC_WEAPON(weapon_electro, WEP_ELECTRO) .float dmg; .float dmg_edge; .float dmg_radius; -.float dmg_force; .float dmg_duration; .float dmg_last; .float dmg_interval; -- 2.39.2