]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into drjaska/q3df-rl-h-force
authordrjaska <drjaska83@gmail.com>
Fri, 23 Aug 2024 23:22:34 +0000 (02:22 +0300)
committerdrjaska <drjaska83@gmail.com>
Fri, 23 Aug 2024 23:22:34 +0000 (02:22 +0300)
1  2 
bal-wep-mario.cfg
bal-wep-nexuiz25.cfg
bal-wep-samual.cfg
bal-wep-xdf.cfg
bal-wep-xonotic.cfg
qcsrc/common/weapons/weapon/blaster.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/server/damage.qc
qcsrc/server/damage.qh

Simple merge
Simple merge
Simple merge
diff --cc bal-wep-xdf.cfg
Simple merge
Simple merge
index 9fabb70d2683177a66b50c1c720f795e052df825,d5a9a20c760d352a7d6631ed2530eba9cf2faad4..1aa0ac54fff78166b034d4811a923320acc0e298
@@@ -939,22 -945,66 +945,66 @@@ float RadiusDamageForSource (entity inf
                                        float a;
                                        float c;
                                        vector hitloc;
-                                       vector myblastorigin;
-                                       vector center;
-                                       myblastorigin = WarpZone_TransformOrigin(targ, inflictororigin);
  
                                        // if it's a player, use the view origin as reference
-                                       center = CENTER_OR_VIEWOFS(targ);
+                                       vector center = CENTER_OR_VIEWOFS(targ);
+                                       if (autocvar_g_player_damageplayercenter)
+                                       {
+                                               if (targ != attacker)
+                                               {
+                                                       // always use target's bbox centerpoint
+                                                       center = targ.origin + ((targ.mins + targ.maxs) * 0.5);
+                                               }
+                                               else // targ == attacker
+                                               {
+                                               #if 0
+                                                       // code stolen from W_SetupShot_Dir_ProjectileSize_Range()
+                                                       vector md = targ.(weaponentity).movedir;
+                                                       vector dv = v_right * -md.y + v_up * md.z;
+                                                       vector mi = '0 0 0', ma = '0 0 0';
  
-                                       force = normalize(center - myblastorigin);
-                                       force = force * (finaldmg / coredamage) * forceintensity;
+                                                       if(IS_CLIENT(targ)) // no antilag for non-clients!
+                                                       {
+                                                               if(CS(targ).antilag_debug)
+                                                                       tracebox_antilag(targ, center, mi, ma, center + dv, MOVE_NORMAL, targ, CS(targ).antilag_debug);
+                                                               else
+                                                                       tracebox_antilag(targ, center, mi, ma, center + dv, MOVE_NORMAL, targ, ANTILAG_LATENCY(targ));
+                                                       }
+                                                       else
+                                                               tracebox(center, mi, ma, center + dv, MOVE_NORMAL, targ);
+                                                       center.z = trace_endpos.z;
+                                               #else
+                                                       // very cheap way but it skips move into solid checks which is fine most of the time for now AFAIK
+                                                       // this should only really be an issue with some rare edge cases where
+                                                       // shot origin was prevented from going into a ceiling but it still explodes at the ceiling
+                                                       // shot origin wasn't raised as high as possible and the shooter gets upwards knockback
+                                                       // TL;DR: no bugs if vertical shot origin is always within player bbox
+                                                       center.z = center.z + targ.(weaponentity).movedir.z;
+                                               #endif
+                                               }
+                                       }
+                                       /* debug prints
+                                       print(sprintf("origin  vec %v\n", targ.origin));
+                                       print(sprintf("movedir vec %v\n", targ.(weaponentity).movedir));
+                                       print(sprintf("old def vec %v\n", CENTER_OR_VIEWOFS(targ)));
+                                       print(sprintf("origin+vofs %v\n", targ.origin + targ.view_ofs));
+                                       print(sprintf("bbox center %v\n", (targ.origin + ((targ.mins + targ.maxs) * 0.5))));
+                                       print(sprintf("center  vec %v\n", center));
+                                       print(sprintf("shotorg vec %v\n", w_shotorg));
+                                       print("\n");
+                                       */
+                                       force = normalize(center - inflictororigin_wz);
+                                       force = force * (finaldmg / max(coredamage, edgedamage)) * forceintensity;
                                        hitloc = nearest;
  
 -                                      // apply special scaling along the z axis if set
 -                                      // NOTE: 0 value is not allowed for compatibility, in the case of weapon cvars not being set
 -                                      if(forcezscale)
 -                                              force.z *= forcezscale;
 +                                      // apply special force scalings
 +                                      force.x *= forcexyzscale.x;
 +                                      force.y *= forcexyzscale.y;
 +                                      force.z *= forcexyzscale.z;
  
                                        if(targ != directhitentity)
                                        {
  
  float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, .entity weaponentity, entity directhitentity)
  {
-       return RadiusDamageForSource(inflictor, (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5), inflictor.velocity, attacker, coredamage, edgedamage, rad, 
+       return RadiusDamageForSource(inflictor, (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5), inflictor.velocity, attacker, coredamage, edgedamage, rad,
 -                                                                      cantbe, mustbe, false, forceintensity, 1, deathtype, weaponentity, directhitentity);
 +                                                                      cantbe, mustbe, false, forceintensity, '1 1 1', deathtype, weaponentity, directhitentity);
  }
  
  bool Heal(entity targ, entity inflictor, float amount, float limit)
Simple merge