From b9fd32ef1ba5d146799fe22184e0a9e77dc49dc2 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Wed, 24 Aug 2011 12:17:21 +0200 Subject: [PATCH] simplify crylink code, handle removal by skybox proactively --- qcsrc/server/miscfunctions.qc | 6 ++++++ qcsrc/server/w_crylink.qc | 25 ++----------------------- 2 files changed, 8 insertions(+), 23 deletions(-) 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); -- 2.39.2