From: Rudolf Polzer Date: Thu, 15 Sep 2011 20:16:01 +0000 (+0200) Subject: fix the same hook bug another, REAL, way :P X-Git-Tag: xonotic-v0.6.0~40^2~137 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c575fe648386f205d0c0b2f94dab55a48da3fe88;p=xonotic%2Fxonotic-data.pk3dir.git fix the same hook bug another, REAL, way :P --- diff --git a/qcsrc/server/arena.qc b/qcsrc/server/arena.qc index b2e4f1019..c89c2b2ef 100644 --- a/qcsrc/server/arena.qc +++ b/qcsrc/server/arena.qc @@ -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 { diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index bd5b2c328..76faad923 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -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;