]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
reindent RadiusDamage, it was a mess
authorRudolf Polzer <divverent@xonotic.org>
Wed, 18 Apr 2012 14:32:59 +0000 (16:32 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Wed, 18 Apr 2012 14:32:59 +0000 (16:32 +0200)
qcsrc/server/g_damage.qc

index b32d3ac6b2693bbb3d325c9757b3965b41bfcec6..34b31be1a6b105d8ceab064037950cabfe4ca628 100644 (file)
@@ -981,7 +981,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
 
 float RadiusDamage_running;
 float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity ignore, float forceintensity, float deathtype, entity directhitentity)
-// Returns total damage applies to creatures
+       // Returns total damage applies to creatures
 {
        entity  targ;
        float   finaldmg;
@@ -1013,18 +1013,18 @@ float RadiusDamage (entity inflictor, entity attacker, float coredamage, float e
        total_damage_to_creatures = 0;
 
        if(deathtype != (WEP_HOOK | HITTYPE_SECONDARY | HITTYPE_BOUNCE)) // only send gravity bomb damage once
-       if(DEATH_WEAPONOF(deathtype) != WEP_TUBA) // do not send tuba damage (bandwidth hog)
-       {
-               force = inflictor.velocity;
-               if(vlen(force) == 0)
-                       force = '0 0 -1';
-               else
-                       force = normalize(force);
-               if(forceintensity >= 0)
-                       Damage_DamageInfo(blastorigin, coredamage, edgedamage, rad, forceintensity * force, deathtype, 0, attacker);
-               else
-                       Damage_DamageInfo(blastorigin, coredamage, edgedamage, -rad, (-forceintensity) * force, deathtype, 0, attacker);
-       }
+               if(DEATH_WEAPONOF(deathtype) != WEP_TUBA) // do not send tuba damage (bandwidth hog)
+               {
+                       force = inflictor.velocity;
+                       if(vlen(force) == 0)
+                               force = '0 0 -1';
+                       else
+                               force = normalize(force);
+                       if(forceintensity >= 0)
+                               Damage_DamageInfo(blastorigin, coredamage, edgedamage, rad, forceintensity * force, deathtype, 0, attacker);
+                       else
+                               Damage_DamageInfo(blastorigin, coredamage, edgedamage, -rad, (-forceintensity) * force, deathtype, 0, attacker);
+               }
 
        stat_damagedone = 0;
 
@@ -1127,47 +1127,47 @@ float RadiusDamage (entity inflictor, entity attacker, float coredamage, float e
                                                // laser force adjustments :P
                                                if(DEATH_WEAPONOF(deathtype) == WEP_LASER)
                                                {
-                            if (targ == attacker)
-                            {
-                                vector vel;
-
-                                float force_zscale;
-                                float force_velocitybiasramp;
-                                float force_velocitybias;
-
-                                force_velocitybiasramp = autocvar_sv_maxspeed;
-                                if(deathtype & HITTYPE_SECONDARY)
-                                {
-                                    force_zscale = autocvar_g_balance_laser_secondary_force_zscale;
-                                    force_velocitybias = autocvar_g_balance_laser_secondary_force_velocitybias;
-                                }
-                                else
-                                {
-                                    force_zscale = autocvar_g_balance_laser_primary_force_zscale;
-                                    force_velocitybias = autocvar_g_balance_laser_primary_force_velocitybias;
-                                }
-
-                                vel = targ.velocity;
-                                vel_z = 0;
-                                vel = normalize(vel) * bound(0, vlen(vel) / force_velocitybiasramp, 1) * force_velocitybias;
-                                force =
-                                    vlen(force)
-                                    *
-                                    normalize(normalize(force) + vel);
-
-                                force_z *= force_zscale;
-                            }
-                            else
-                            {
-                                if(deathtype & HITTYPE_SECONDARY)
-                                {
-                                    force *= autocvar_g_balance_laser_secondary_force_other_scale;
-                                }
-                                else
-                                {
-                                    force *= autocvar_g_balance_laser_primary_force_other_scale;
-                                }
-                            }
+                                                       if (targ == attacker)
+                                                       {
+                                                               vector vel;
+
+                                                               float force_zscale;
+                                                               float force_velocitybiasramp;
+                                                               float force_velocitybias;
+
+                                                               force_velocitybiasramp = autocvar_sv_maxspeed;
+                                                               if(deathtype & HITTYPE_SECONDARY)
+                                                               {
+                                                                       force_zscale = autocvar_g_balance_laser_secondary_force_zscale;
+                                                                       force_velocitybias = autocvar_g_balance_laser_secondary_force_velocitybias;
+                                                               }
+                                                               else
+                                                               {
+                                                                       force_zscale = autocvar_g_balance_laser_primary_force_zscale;
+                                                                       force_velocitybias = autocvar_g_balance_laser_primary_force_velocitybias;
+                                                               }
+
+                                                               vel = targ.velocity;
+                                                               vel_z = 0;
+                                                               vel = normalize(vel) * bound(0, vlen(vel) / force_velocitybiasramp, 1) * force_velocitybias;
+                                                               force =
+                                                                       vlen(force)
+                                                                       *
+                                                                       normalize(normalize(force) + vel);
+
+                                                               force_z *= force_zscale;
+                                                       }
+                                                       else
+                                                       {
+                                                               if(deathtype & HITTYPE_SECONDARY)
+                                                               {
+                                                                       force *= autocvar_g_balance_laser_secondary_force_other_scale;
+                                                               }
+                                                               else
+                                                               {
+                                                                       force *= autocvar_g_balance_laser_primary_force_other_scale;
+                                                               }
+                                                       }
                                                }
 
                                                //if (targ == attacker)