From: Mircea Kitsune Date: Sun, 3 Oct 2010 18:39:14 +0000 (+0300) Subject: Fix a very rare and major issue that took place if someone killtarget'ed a func_bobbi... X-Git-Tag: xonotic-v0.1.0preview~307^2~22^2~1^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4ba4a5e3af3d157b538cf9b7253d88dbf0dc8e6d;p=xonotic%2Fxonotic-data.pk3dir.git Fix a very rare and major issue that took place if someone killtarget'ed a func_bobbing on a map (not something you commonly do but I found a way to fix it). Issue description: Make a map and place a func_bobbing on it, a trigger_multiple that killtarget's the func_bobbing, and the hook gun pickup somewhere. Get the hook gun in that map and shoot at the walls with it (make sure the map is large enough so the hook flies for at least one second before hitting a wall). The hook will behave normally. Now trigger the trigger_multiple and watch it make the func_bobbing disappear like it should. However, from this point on, shooting the hook gun will cause the hook to change direction in the air and go toward origin '0 0 0' half of the time you shoot it. This seems to be because the func_bobbing's controller (that moves it up and down) attaches to the hook projectile if the func_bobbing is killed, for an unknown reason (likely happens with other projectiles too). So I added a check that makes it only change the velocity of func_bobbing as long as its classname corresponds. That way, if someone makes a map where they want to killtarget a func_bobbing for whatever reason, that won't brake projectiles. --- diff --git a/qcsrc/server/t_plats.qc b/qcsrc/server/t_plats.qc index 583fc7359..0d8233da5 100644 --- a/qcsrc/server/t_plats.qc +++ b/qcsrc/server/t_plats.qc @@ -418,8 +418,9 @@ void func_bobbing_controller_think() // calculate sinewave using makevectors makevectors((self.nextthink * self.owner.cnt + self.owner.phase * 360) * '0 1 0'); v = self.owner.destvec + self.owner.movedir * v_forward_y; - // * 10 so it will arrive in 0.1 sec - self.owner.velocity = (v - self.owner.origin) * 10; + if(self.owner.classname == "func_bobbing") // don't brake stuff if the func_bobbing was killtarget'ed + // * 10 so it will arrive in 0.1 sec + self.owner.velocity = (v - self.owner.origin) * 10; }; void bobbing_blocked()