From 06b316e367424938029365911244d9c5bfa9c7ca Mon Sep 17 00:00:00 2001 From: div0 Date: Wed, 18 Apr 2007 17:29:52 +0000 Subject: [PATCH] Dear havocbots, don't try to move in air on a jumppad ride. You can't control it, so don't. git-svn-id: svn://svn.icculus.org/nexuiz/trunk@2340 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/havocbot.qc | 10 ++++++++++ data/qcsrc/server/t_jumppads.qc | 35 ++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/data/qcsrc/server/havocbot.qc b/data/qcsrc/server/havocbot.qc index e548a77e1..13f20604d 100644 --- a/data/qcsrc/server/havocbot.qc +++ b/data/qcsrc/server/havocbot.qc @@ -71,6 +71,15 @@ void() havocbot_movetogoal = //if (self.goalentity) // te_lightning2(self, self.origin, (self.goalentity.absmin + self.goalentity.absmax) * 0.5); self.movement = '0 0 0'; + + if(self.jumppadcount) + { + if(self.flags & FL_ONGROUND) + self.jumppadcount = FALSE; + else + return; + } + if (self.goalcurrent == world) return; navigation_poptouchedgoals(); @@ -195,6 +204,7 @@ void() havocbot_movetogoal = self.movement_x = dir * v_forward; self.movement_y = dir * v_right; if (self.flags & FL_INWATER) self.movement_z = dir * v_up; else self.movement_z = 0; + if ((dir * v_up) >= cvar("g_balance_jumpheight")*0.5 && (self.flags & FL_ONGROUND)) self.button2=1; if (((dodge * v_up) > 0) && random()*frametime >= 0.2*bound(0,(10-skill)*0.1,1)) self.button2=TRUE; if (((dodge * v_up) < 0) && random()*frametime >= 0.5*bound(0,(10-skill)*0.1,1)) self.havocbot_ducktime=time+0.3/bound(0.1,skill,10); diff --git a/data/qcsrc/server/t_jumppads.qc b/data/qcsrc/server/t_jumppads.qc index 8ae936924..781a4fc6c 100644 --- a/data/qcsrc/server/t_jumppads.qc +++ b/data/qcsrc/server/t_jumppads.qc @@ -126,24 +126,27 @@ void() trigger_push_touch = } if (other.classname == "player") - { - local float i; - local float found; - if(self.pushltime < time) // prevent "snorring" sound when a player hits the jumppad more than once - { - sound (other, CHAN_ITEM, "misc/jumppad.ogg", 1, ATTN_NORM); - self.pushltime = time + 0.5; - } - found = FALSE; - for(i = 0; i < other.jumppadcount && i < NUM_JUMPPADSUSED; ++i) - if(other.(jumppadsused[i]) == self) - found = TRUE; - if(!found) + if(clienttype(other) == CLIENTTYPE_REAL) { - other.(jumppadsused[math_mod(other.jumppadcount, NUM_JUMPPADSUSED)]) = self; - other.jumppadcount = other.jumppadcount + 1; + local float i; + local float found; + if(self.pushltime < time) // prevent "snorring" sound when a player hits the jumppad more than once + { + sound (other, CHAN_ITEM, "misc/jumppad.ogg", 1, ATTN_NORM); + self.pushltime = time + 0.5; + } + found = FALSE; + for(i = 0; i < other.jumppadcount && i < NUM_JUMPPADSUSED; ++i) + if(other.(jumppadsused[i]) == self) + found = TRUE; + if(!found) + { + other.(jumppadsused[math_mod(other.jumppadcount, NUM_JUMPPADSUSED)]) = self; + other.jumppadcount = other.jumppadcount + 1; + } } - } + else + other.jumppadcount = TRUE; self.movedir = trigger_push_calculatevelocity(other.origin, self.enemy, self.height); -- 2.39.2