]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/arc.qc
Fix Arc bolts bouncing more times than they're supposed to, rename the bounce_damage...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / arc.qc
index 2f9b84ed551852c6effa4b17a9b7e5fc0d509fca..44fd539bebc5feca780e89e059f5a5f7de1c8461 100644 (file)
@@ -118,19 +118,18 @@ void W_Arc_Bolt_Damage(entity this, entity inflictor, entity attacker, float dam
 void W_Arc_Bolt_Touch(entity this, entity toucher)
 {
        PROJECTILE_TOUCH(this, toucher);
-       if(this.cnt > WEP_CVAR(arc, bolt_bounce_count) || !WEP_CVAR(arc, bolt_bounce_count) || toucher.takedamage == DAMAGE_AIM) {
+       if(this.cnt >= WEP_CVAR(arc, bolt_bounce_count) || !WEP_CVAR(arc, bolt_bounce_count) || toucher.takedamage == DAMAGE_AIM) {
                this.use(this, NULL, toucher);
        } else {
-               if(!this.cnt && WEP_CVAR(arc, bolt_bounce_lifetime))
-                       this.nextthink = min(this.nextthink, time + WEP_CVAR(arc, bolt_bounce_lifetime));
                this.cnt++;
                Send_Effect(EFFECT_BALL_SPARKS, this.origin, this.velocity, 1);
                this.angles = vectoangles(this.velocity);
                this.owner = NULL;
-               // initial blast doesn't count as bounce damage!
-               if(WEP_CVAR(arc, bolt_bounce_damage))
-                       RadiusDamage(this, this.realowner, WEP_CVAR(arc, bolt_damage), WEP_CVAR(arc, bolt_edgedamage), WEP_CVAR(arc, bolt_radius), NULL, NULL, WEP_CVAR(arc, bolt_force), this.projectiledeathtype, this.weaponentity_fld, toucher);
                this.projectiledeathtype |= HITTYPE_BOUNCE;
+               if(WEP_CVAR(arc, bolt_bounce_explode))
+                       RadiusDamage(this, this.realowner, WEP_CVAR(arc, bolt_damage), WEP_CVAR(arc, bolt_edgedamage), WEP_CVAR(arc, bolt_radius), NULL, NULL, WEP_CVAR(arc, bolt_force), this.projectiledeathtype, this.weaponentity_fld, toucher);
+               if(this.cnt == 1 && WEP_CVAR(arc, bolt_bounce_lifetime))
+                       this.nextthink = time + WEP_CVAR(arc, bolt_bounce_lifetime);
        }
 }