]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
simplify crylink code, handle removal by skybox proactively
authorRudolf Polzer <divverent@alientrap.org>
Wed, 24 Aug 2011 10:17:21 +0000 (12:17 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Wed, 24 Aug 2011 10:17:21 +0000 (12:17 +0200)
qcsrc/server/miscfunctions.qc
qcsrc/server/w_crylink.qc

index 3bb6e6b7ca0d65d9472b1d905e67e870735a6b03..0dca3ab282030c4bc98969ddcbda261b16b2a90b 100644 (file)
@@ -2017,6 +2017,7 @@ float SUB_NoImpactCheck()
 #define SUB_OwnerCheck() (other && (other == self.owner))
 
 void RemoveGrapplingHook(entity pl);
+void W_Crylink_Dequeue(entity e);
 float WarpZone_Projectile_Touch_ImpactFilter_Callback()
 {
        if(SUB_OwnerCheck())
@@ -2025,6 +2026,11 @@ float WarpZone_Projectile_Touch_ImpactFilter_Callback()
        {
                if(self.classname == "grapplinghook")
                        RemoveGrapplingHook(self.realowner);
+               else if(self.classname == "spike")
+               {
+                       W_Crylink_Dequeue(self);
+                       remove(self);
+               }
                else
                        remove(self);
                return TRUE;
index f3942a240e8ccafb66368ebddcc92079c2afabff..6a77e98a882ccc2c1fb329db1b2b25b03e87fd13 100644 (file)
@@ -215,23 +215,12 @@ void W_Crylink_LinkJoinEffect_Think()
        remove(self);
 }
 
-
 // NO bounce protection, as bounces are limited!
 void W_Crylink_Touch (void)
 {
        float finalhit;
        float f;
-       //PROJECTILE_TOUCH;
-       local entity savenext, saveprev, saveown;
-       saveown = self.realowner;
-       savenext = self.queuenext;
-       saveprev = self.queueprev;
-       if(WarpZone_Projectile_Touch())
-       {
-               if(wasfreed(self))
-                       W_Crylink_Dequeue_Raw(saveown, saveprev, self, savenext);
-               return;
-       }
+       PROJECTILE_TOUCH;
 
        float a;
        a = bound(0, 1 - (time - self.fade_time) * self.fade_rate, 1);
@@ -271,17 +260,7 @@ void W_Crylink_Touch2 (void)
 {
        float finalhit;
        float f;
-       //PROJECTILE_TOUCH;
-       local entity savenext, saveprev, saveown;
-       savenext = self.queuenext;
-       saveprev = self.queueprev;
-       saveown = self.realowner;
-       if(WarpZone_Projectile_Touch())
-       {
-               if(wasfreed(self))
-                       W_Crylink_Dequeue_Raw(saveown, saveprev, self, savenext);
-               return;
-       }
+       PROJECTILE_TOUCH;
 
        float a;
        a = bound(0, 1 - (time - self.fade_time) * self.fade_rate, 1);