#else
#ifdef SVQC
.float gravity;
+.float crylink_release;
+.entity crylink_lastgroup;
.entity queuenext;
.entity queueprev;
+void W_Crylink_Dequeue_Raw(entity own, entity prev, entity me, entity next)
+{
+ if(me == own.crylink_lastgroup)
+ own.crylink_lastgroup = ((me == next) ? world : next);
+ prev.queuenext = next;
+ next.queueprev = prev;
+}
+
+void W_Crylink_Dequeue(entity e)
+{
+ W_Crylink_Dequeue_Raw(e.realowner, e.queueprev, e, e.queuenext);
+}
+
// force projectile to explode
void W_Crylink_LinkExplode (entity e, entity e2)
{
float finalhit;
float f;
//PROJECTILE_TOUCH;
- local entity savenext, saveprev;
+ local entity savenext, saveprev, saveown;
+ saveown = self.realowner;
savenext = self.queuenext;
saveprev = self.queueprev;
if(WarpZone_Projectile_Touch())
{
if(wasfreed(self))
- {
- savenext.queueprev = saveprev;
- saveprev.queuenext = savenext;
- }
+ W_Crylink_Dequeue_Raw(saveown, saveprev, self, savenext);
return;
}
float finalhit;
float f;
//PROJECTILE_TOUCH;
- local entity savenext, saveprev;
+ local entity savenext, saveprev, saveown;
savenext = self.queuenext;
saveprev = self.queueprev;
+ saveown = self.realowner;
if(WarpZone_Projectile_Touch())
{
if(wasfreed(self))
- {
- savenext.queueprev = saveprev;
- saveprev.queuenext = savenext;
- }
+ W_Crylink_Dequeue_Raw(saveown, saveprev, self, savenext);
return;
}
else if(finalhit)
{
// just unlink
- self.queuenext.queueprev = self.queueprev;
- self.queueprev.queuenext = self.queuenext;
+ W_Crylink_Dequeue(self);
remove(self);
return;
}
void W_Crylink_Fadethink (void)
{
- self.queuenext.queueprev = self.queueprev;
- self.queueprev.queuenext = self.queuenext;
+ W_Crylink_Dequeue(self);
remove(self);
}
shots = cvar("g_balance_crylink_primary_shots");
pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
+ proj = world;
while (counter < shots)
{
proj = spawn ();
counter = counter + 1;
}
+ self.crylink_lastgroup = proj;
}
void W_Crylink_Attack2 (void)
shots = cvar("g_balance_crylink_secondary_shots");
pointparticles(particleeffectnum("crylink_muzzleflash"), w_shotorg, w_shotdir * 1000, shots);
+ proj = world;
while (counter < shots)
{
proj = spawn ();
counter = counter + 1;
}
+ self.crylink_lastgroup = proj;
}
void spawnfunc_weapon_crylink (void)