Make sure smoke effects can't be spammed too much
authorMario <mario@smbclan.net>
Wed, 6 Jan 2016 06:50:35 +0000 (16:50 +1000)
committerMario <mario@smbclan.net>
Wed, 6 Jan 2016 06:50:35 +0000 (16:50 +1000)
qcsrc/common/vehicles/sv_vehicles.qc

index 0c1574e2e6a9c1f82c93e5ca12e126182ea0262e..6224eca65405785188e4e2f3ed6463929a20b7f8 100644 (file)
@@ -615,8 +615,8 @@ void vehicles_painframe(entity this)
        if(this.pain_frame < time)
        {
                float _ftmp = myhealth / 50;
-               this.pain_frame = time + 0.1 + (random() * 0.5 * _ftmp);
-               pointparticles(EFFECT_SMOKE_SMALL, (this.origin + (randomvec() * 80)), '0 0 0', 1);
+               this.pain_frame = time + max(0.1, 0.1 + (random() * 0.5 * _ftmp));
+               Send_Effect(EFFECT_SMOKE_SMALL, (this.origin + (randomvec() * 80)), '0 0 0', 1);
 
                if(this.vehicle_flags & VHF_DMGSHAKE)
                        this.velocity += randomvec() * 30;