From: Rudolf Polzer Date: Wed, 24 Aug 2011 10:17:21 +0000 (+0200) Subject: simplify crylink code, handle removal by skybox proactively X-Git-Tag: xonotic-v0.5.0~66^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b9fd32ef1ba5d146799fe22184e0a9e77dc49dc2;p=xonotic%2Fxonotic-data.pk3dir.git simplify crylink code, handle removal by skybox proactively --- diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 3bb6e6b7c..0dca3ab28 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -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; diff --git a/qcsrc/server/w_crylink.qc b/qcsrc/server/w_crylink.qc index f3942a240..6a77e98a8 100644 --- a/qcsrc/server/w_crylink.qc +++ b/qcsrc/server/w_crylink.qc @@ -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);