]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fix the same hook bug another, REAL, way :P
authorRudolf Polzer <divverent@xonotic.org>
Thu, 15 Sep 2011 20:16:01 +0000 (22:16 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Thu, 15 Sep 2011 20:16:01 +0000 (22:16 +0200)
qcsrc/server/arena.qc
qcsrc/server/g_hook.qc

index b2e4f1019d2f522981ea567734e4192c9cb3f9a6..c89c2b2efada451a84b1990255d437641088195b 100644 (file)
@@ -55,12 +55,6 @@ void reset_map(float dorespawn)
 
        race_ReadyRestart();
 
-       FOR_EACH_CLIENT(self) {
-               // just to make sure, as the FL_PROJECTILE handling is bad for
-               // these
-               RemoveGrapplingHook();
-       }
-
        for(self = world; (self = nextent(self)); )
        if(clienttype(self) == CLIENTTYPE_NOTACLIENT && self.items != IT_STRENGTH && self.items != IT_INVINCIBLE) // don't respawn strength or shield, that will only lead to them spawning very early each match
        {
index bd5b2c328d01a8ae6ca748d578f700a59489b1e2..76faad923281b026a45773f292bfc91854f78789 100644 (file)
@@ -62,6 +62,14 @@ void RemoveGrapplingHook(entity pl)
        //pl.disableclientprediction = FALSE;
 }
 
+void GrapplingHookReset(void)
+{
+       if(self.realowner.hook == self)
+               RemoveGrapplingHook(self.owner);
+       else // in any case:
+               remove(self);
+}
+
 void GrapplingHookThink();
 void GrapplingHook_Stop()
 {
@@ -311,6 +319,7 @@ void FireGrapplingHook (void)
        missile = WarpZone_RefSys_SpawnSameRefSys(self);
        missile.owner = missile.realowner = self;
        self.hook = missile;
+       missile.reset = GrapplingHookReset;
        missile.classname = "grapplinghook";
 
        missile.movetype = MOVETYPE_FLY;