]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Simplify time check and remove push force from combos over time
authorMario <mario.mario@y7mail.com>
Tue, 30 Jul 2024 11:50:32 +0000 (21:50 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 30 Jul 2024 11:50:32 +0000 (21:50 +1000)
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/electro.qh

index 045c5cb9a973859bb4860ec1039de0770c739507..cb8ea617b134f5bc1b06cc7b61e326203b4fd5ea 100644 (file)
@@ -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;
index be3bcfb5e9b40789892c13c0e79f1c2a9daad257..f8e53ee759bc5776c82c0327b9b3ec53ea349679 100644 (file)
@@ -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;