]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix decals not appearing when a projectile with 0 size (blaster, crylink, hagar)...
authorterencehill <piuntn@gmail.com>
Sun, 8 Jan 2023 17:30:32 +0000 (18:30 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 9 Jan 2023 11:11:26 +0000 (12:11 +0100)
Now the w_backoff factor is 2 for all weapons, except for the hook (-2) whose bomb explodes slightly below the floor

22 files changed:
qcsrc/common/effects/qc/damageeffects.qc
qcsrc/common/mutators/mutator/overkill/okhmg.qc
qcsrc/common/mutators/mutator/overkill/okmachinegun.qc
qcsrc/common/mutators/mutator/overkill/oknex.qc
qcsrc/common/mutators/mutator/overkill/okrpc.qc
qcsrc/common/weapons/weapon/arc.qc
qcsrc/common/weapons/weapon/blaster.qc
qcsrc/common/weapons/weapon/crylink.qc
qcsrc/common/weapons/weapon/devastator.qc
qcsrc/common/weapons/weapon/electro.qc
qcsrc/common/weapons/weapon/fireball.qc
qcsrc/common/weapons/weapon/hagar.qc
qcsrc/common/weapons/weapon/hlac.qc
qcsrc/common/weapons/weapon/hook.qc
qcsrc/common/weapons/weapon/machinegun.qc
qcsrc/common/weapons/weapon/minelayer.qc
qcsrc/common/weapons/weapon/mortar.qc
qcsrc/common/weapons/weapon/rifle.qc
qcsrc/common/weapons/weapon/seeker.qc
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/common/weapons/weapon/vaporizer.qc
qcsrc/common/weapons/weapon/vortex.qc

index 20a335b6b8aac92dab451125497cabc9cec43d68..847a9d34087bb3890934b336636e4e74f583c93c 100644 (file)
@@ -396,8 +396,12 @@ NET_HANDLE(ENT_CLIENT_DAMAGEINFO, bool isNew)
                w_random = prandom();
 
                vector force_dir = normalize(force);
+               // this traceline usually starts in solid when a hitscan shot hits a surface with a very small angle
+               // if so, try another traceline starting further back (may still start in solid but only with extremely small angles)
                traceline(w_org - force_dir * 16, w_org + force_dir * 16, MOVE_NOMONSTERS, NULL);
-               if(trace_fraction < 1 && !(hitwep.spawnflags & WEP_TYPE_HITSCAN))
+               if(trace_startsolid)
+                       traceline(w_org - force_dir * 40, w_org + force_dir * 16, MOVE_NOMONSTERS, NULL);
+               if(trace_fraction < 1)
                        w_backoff = trace_plane_normal;
                else
                        w_backoff = -force_dir;
index 1d8c5e87f9aa043252c00dac81e78152066dd2b6..0bc9af4bef6e8f8e170ca938420d106072133ba5 100644 (file)
@@ -149,8 +149,7 @@ METHOD(OverkillHeavyMachineGun, wr_killmessage, Notification(entity thiswep))
 
 METHOD(OverkillHeavyMachineGun, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2;
-    org2 = w_org + w_backoff * 2;
+    vector org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1);
     if(!w_issilent)
         sound(actor, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTEN_NORM);
index a86cdc5194f3f2e21f7c936423a5bc41a913922b..25a0b454bc9c7552eb756d70fd2dd624d740e18c 100644 (file)
@@ -136,8 +136,7 @@ METHOD(OverkillMachineGun, wr_killmessage, Notification(entity thiswep))
 
 METHOD(OverkillMachineGun, wr_impacteffect, void(entity thiswep, entity actor))
 {
-       vector org2;
-       org2 = w_org + w_backoff * 2;
+       vector org2 = w_org + w_backoff * 2;
        pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1);
        if(!w_issilent)
                sound(actor, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTN_NORM);
index 85f33714054e1560f40c0ccf28a12a83b1b0c048..c1240a45f2d73a05ebab0a3bb74d1dc14b7556a9 100644 (file)
@@ -324,7 +324,7 @@ METHOD(OverkillNex, wr_zoom, bool(entity thiswep, entity actor))
 METHOD(OverkillNex, wr_impacteffect, void(entity thiswep, entity actor))
 {
        entity this = actor;
-       vector org2 = w_org + w_backoff * 6;
+       vector org2 = w_org + w_backoff * 2;
        pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1);
        if(!w_issilent)
                sound(this, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM);
index 4610a0b1d852924623d7d2e22b1985e07b1cc1d5..ccfc399a3688ac73b3b632e7f087b7eebaa97fba 100644 (file)
@@ -224,8 +224,7 @@ METHOD(OverkillRocketPropelledChainsaw, wr_killmessage, Notification(entity this
 
 METHOD(OverkillRocketPropelledChainsaw, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2;
-    org2 = w_org + w_backoff * 12;
+    vector org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
         sound(actor, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTEN_NORM);
index aa1a637c908a5b55f5fe754da206d8163e26e5b9..43d7a03a400dae69ba74e6e6858435ad9ad113fe 100644 (file)
@@ -795,8 +795,7 @@ METHOD(Arc, wr_impacteffect, void(entity thiswep, entity actor))
 {
     if(w_deathtype & HITTYPE_SECONDARY)
     {
-        vector org2;
-        org2 = w_org + w_backoff * 6;
+        vector org2 = w_org + w_backoff * 2;
         pointparticles(EFFECT_ELECTRO_IMPACT, org2, w_backoff * 1000, 1);
         if(!w_issilent) { sound(actor, CH_SHOTS, SND_ELECTRO_IMPACT, VOL_BASE, ATTN_NORM); }
     }
index 6902f48532d0e13ea3f1deb4c148530a28e63a2c..874d19639e3b1b4835d4ce71bab69a8ef4c7a61d 100644 (file)
@@ -219,8 +219,7 @@ METHOD(OffhandBlaster, offhand_think, void(OffhandBlaster this, entity actor, bo
 
 METHOD(Blaster, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2;
-    org2 = w_org + w_backoff * 6;
+    vector org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
     if(!w_issilent) { sound(actor, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM); }
 }
index 86dd8fc929db6113253b97ddd37ae402cf31cc4a..ae1eae28459adfb50c468fc37571feb1000e9a69 100644 (file)
@@ -619,8 +619,7 @@ METHOD(Crylink, wr_killmessage, Notification(entity thiswep))
 #ifdef CSQC
 METHOD(Crylink, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2;
-    org2 = w_org + w_backoff * 2;
+    vector org2 = w_org + w_backoff * 2;
     if(w_deathtype & HITTYPE_SECONDARY)
     {
         pointparticles(EFFECT_CRYLINK_IMPACT2, org2, '0 0 0', 1);
index 9ad68db2741d4e73f2c3514e15177b5e5f4ec14d..6f428dc6c413430cb52440659da1c3a5eac6e6b5 100644 (file)
@@ -586,8 +586,7 @@ METHOD(Devastator, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Devastator, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2;
-    org2 = w_org + w_backoff * 12;
+    vector org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
         sound(actor, CH_SHOTS, SND_ROCKET_IMPACT, VOL_BASE, ATTN_NORM);
index 97929c7dd3736ba0cf68514562ae32fc995954e0..2c03871ce54580335fe95adff435d86d4a555818 100644 (file)
@@ -618,8 +618,7 @@ METHOD(Electro, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Electro, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2;
-    org2 = w_org + w_backoff * 6;
+    vector org2 = w_org + w_backoff * 2;
     if(w_deathtype & HITTYPE_SECONDARY)
     {
         pointparticles(EFFECT_ELECTRO_BALLEXPLODE, org2, '0 0 0', 1);
index 363b1d694141a6e571b16060722c77fbdc5c1811..f7c77c514ab4298e5b46dadab1bc6a54d9bc3827 100644 (file)
@@ -413,14 +413,13 @@ METHOD(Fireball, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Fireball, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2;
     if(w_deathtype & HITTYPE_SECONDARY)
     {
         // firemine goes out silently
     }
     else
     {
-        org2 = w_org + w_backoff * 16;
+        vector org2 = w_org + w_backoff * 2;
         pointparticles(EFFECT_FIREBALL_EXPLODE, org2, '0 0 0', 1);
         if(!w_issilent)
             sound(actor, CH_SHOTS, SND_FIREBALL_IMPACT2, VOL_BASE, ATTEN_NORM * 0.25); // long range boom
index 82f75f3633e63e70dc68792a7611ce701f0f5c5d..a8c12efccd2002dad48197ffccd8be1b6be6a3c0 100644 (file)
@@ -481,8 +481,7 @@ METHOD(Hagar, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Hagar, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2;
-    org2 = w_org + w_backoff * 6;
+    vector org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_HAGAR_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
     {
index e4db316af9dc49aa36444720cd97d3fd8cd5cc1f..18dde744003019106b11e8b46d373900bf6cefba 100644 (file)
@@ -208,8 +208,7 @@ METHOD(HLAC, wr_killmessage, Notification(entity thiswep))
 
 METHOD(HLAC, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2;
-    org2 = w_org + w_backoff * 6;
+    vector org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
     if(!w_issilent)
         sound(actor, CH_SHOTS, SND_LASERIMPACT, VOL_BASE, ATTN_NORM);
index d9e11dc012fb9d2736a0f04a56853d4ab9c9e14d..278571d1bc2ba09a7e998bacb8e0f52d540fb24f 100644 (file)
@@ -243,8 +243,7 @@ METHOD(Hook, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Hook, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2;
-    org2 = w_org + w_backoff * 2;
+    vector org2 = w_org + w_backoff * -2;
     pointparticles(EFFECT_HOOK_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
         sound(actor, CH_SHOTS, SND_HOOKBOMB_IMPACT, VOL_BASE, ATTN_NORM);
index 62b2a09eac9774ab7a68349ced551eb5a24cb9fe..b05f9f720988c73cf34e9ba85ffb9772c8b55e01 100644 (file)
@@ -274,8 +274,7 @@ METHOD(MachineGun, wr_killmessage, Notification(entity thiswep))
 
 METHOD(MachineGun, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2;
-    org2 = w_org + w_backoff * 2;
+    vector org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_MACHINEGUN_IMPACT, org2, w_backoff * 1000, 1);
     if(!w_issilent)
         sound(actor, CH_SHOTS, SND_RIC_RANDOM(), VOL_BASE, ATTN_NORM);
index b1ccb1b05bfd9656c4ce4438aeded71397b7463f..d9fb3f8d06c53a814e5d6bd4b6acf67bd71cacdb 100644 (file)
@@ -494,8 +494,7 @@ METHOD(MineLayer, wr_killmessage, Notification(entity thiswep))
 
 METHOD(MineLayer, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2;
-    org2 = w_org + w_backoff * 12;
+    vector org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_ROCKET_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
         sound(actor, CH_SHOTS, SND_MINE_EXP, VOL_BASE, ATTN_NORM);
index 2152accff03f070d74a8875d4ad8b01e9cfd3dee..442f88265e52a0f5462079e63a96bde3fc8d27e1 100644 (file)
@@ -358,7 +358,8 @@ METHOD(Mortar, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Mortar, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    pointparticles(EFFECT_GRENADE_EXPLODE, w_org + w_backoff, '0 0 0', 1);
+    vector org2 = w_org + w_backoff * 2;
+    pointparticles(EFFECT_GRENADE_EXPLODE, org2, '0 0 0', 1);
     if(!w_issilent)
         sound(actor, CH_SHOTS, SND_GRENADE_IMPACT, VOL_BASE, ATTN_NORM);
 }
index aa4a980623a4168791f700cdd21b523967bc1796..df3b537c1cb82550dc37e52e9c920dab22e9200c 100644 (file)
@@ -199,8 +199,7 @@ METHOD(Rifle, wr_zoom, bool(entity thiswep, entity actor))
 
 METHOD(Rifle, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2;
-    org2 = w_org + w_backoff * 2;
+    vector org2 = w_org + w_backoff * 2;
     pointparticles(EFFECT_RIFLE_IMPACT, org2, w_backoff * 1000, 1);
     if(!w_issilent)
     {
index bf57fb9c1c5bf0e66efad77f3aa54415ec517354..7abb2a43c3f96e3e73df2db9ec6235ae2cdf4691 100644 (file)
@@ -635,8 +635,7 @@ METHOD(Seeker, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Seeker, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2;
-    org2 = w_org + w_backoff * 6;
+    vector org2 = w_org + w_backoff * 2;
     if(w_deathtype & HITTYPE_BOUNCE)
     {
         if(w_deathtype & HITTYPE_SECONDARY)
index 7863de55e33f73a9ba234ede32b57dea60fe6e9e..6c2fd8c933f95a551c11b6a6953498e5fab6d499 100644 (file)
@@ -766,8 +766,7 @@ void Net_ReadShockwaveParticle()
 METHOD(Shockwave, wr_impacteffect, void(entity thiswep, entity actor))
 {
     // handled by Net_ReadShockwaveParticle
-    //vector org2;
-    //org2 = w_org + w_backoff * 2;
+    //vector org2 = w_org + w_backoff * 2;
     //pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
 }
 
index 25aa1b6658c62367fe0f9787f7230f2be7678a4c..b32b3b46913b4a3afef950c915c9ecffb53ec907 100644 (file)
@@ -354,7 +354,7 @@ METHOD(Vaporizer, wr_killmessage, Notification(entity thiswep))
 
 METHOD(Vaporizer, wr_impacteffect, void(entity thiswep, entity actor))
 {
-    vector org2 = w_org + w_backoff * 6;
+    vector org2 = w_org + w_backoff * 2;
     if(w_deathtype & HITTYPE_SECONDARY)
     {
         pointparticles(EFFECT_BLASTER_IMPACT, org2, w_backoff * 1000, 1);
index 5c9ae23a1806d6b4b04801b61a16f8c8ea0c1534..4d4e43ec6cb7ea0356eb8317da2fe5833457d4e0 100644 (file)
@@ -321,7 +321,7 @@ METHOD(Vortex, wr_zoom, bool(entity thiswep, entity actor))
 METHOD(Vortex, wr_impacteffect, void(entity thiswep, entity actor))
 {
        entity this = actor;
-       vector org2 = w_org + w_backoff * 6;
+       vector org2 = w_org + w_backoff * 2;
        pointparticles(EFFECT_VORTEX_IMPACT, org2, '0 0 0', 1);
        if(!w_issilent)
                sound(this, CH_SHOTS, SND_NEXIMPACT, VOL_BASE, ATTN_NORM);