From c9749644cd3944ef5ee0381cf118e76113dd1ba6 Mon Sep 17 00:00:00 2001 From: Jakob MG Date: Thu, 29 Dec 2011 16:24:15 +0100 Subject: [PATCH] Make safepass accrually work --- qcsrc/server/mutators/gamemode_nexball.qc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/qcsrc/server/mutators/gamemode_nexball.qc b/qcsrc/server/mutators/gamemode_nexball.qc index 6faf5851a0..e732efc6f9 100644 --- a/qcsrc/server/mutators/gamemode_nexball.qc +++ b/qcsrc/server/mutators/gamemode_nexball.qc @@ -649,13 +649,14 @@ void spawnfunc_ball_bound(void) void W_Nexball_Think() { - dprint("W_Nexball_Think\n"); + //dprint("W_Nexball_Think\n"); //vector new_dir = steerlib_arrive(self.enemy.origin, 2500); - vector new_dir = steerlib_pull(self.enemy.origin); + vector new_dir = normalize(self.enemy.origin - self.origin); vector old_dir = normalize(self.velocity); - float _speed = vlen(self.velocity); + float _speed = vlen(self.velocity); + vector new_vel = normalize(old_dir + (new_dir * autocvar_g_nexball_safepass_turnrate)) * _speed; + //vector new_vel = (new_dir * autocvar_g_nexball_safepass_turnrate - vector new_vel = (old_dir + (new_dir * autocvar_g_nexball_safepass_turnrate)) * _speed; self.velocity = new_vel; self.nextthink = time; @@ -732,9 +733,11 @@ void W_Nexball_Attack2(void) { if(self.ballcarried.enemy) { - self.ballcarried.think = W_Nexball_Think; - self.ballcarried.nextthink = time; - DropBall(self.ballcarried, w_shotorg, trigger_push_calculatevelocity(self.ballcarried.origin, self.ballcarried.enemy, 32)); + entity _ball = self.ballcarried; + W_SetupShot(self, FALSE, 4, "nexball/shoot1.wav", CH_WEAPON_A, 0); + DropBall(_ball, w_shotorg, trigger_push_calculatevelocity(_ball.origin, _ball.enemy, 32)); + _ball.think = W_Nexball_Think; + _ball.nextthink = time; return; } -- 2.39.2