From: mand1nga Date: Wed, 8 Dec 2010 21:40:39 +0000 (-0300) Subject: Minor changes in jumppads handling X-Git-Tag: xonotic-v0.1.0preview~15^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=582d7bc954acc32da32ec9bd4a57b4ca32ab807e;p=xonotic%2Fxonotic-data.pk3dir.git Minor changes in jumppads handling --- diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index a983e696c..28352cd89 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -453,14 +453,7 @@ void havocbot_movetogoal() // Handling of jump pads if(self.jumppadcount) { - if(self.flags & FL_ONGROUND) - { - self.jumppadcount = FALSE; - if(self.aistatus & AI_STATUS_OUT_JUMPPAD) - self.aistatus &~= AI_STATUS_OUT_JUMPPAD; - } - - // If got stuck on the jump pad try to reach the farther visible item + // If got stuck on the jump pad try to reach the farthest visible item if(self.aistatus & AI_STATUS_OUT_JUMPPAD) { if(fabs(self.velocity_z)<50) @@ -508,11 +501,16 @@ void havocbot_movetogoal() local float threshold; threshold = maxspeed * 0.2; if(fabs(self.velocity_x) < threshold && fabs(self.velocity_y) < threshold) + { + dprint("Warning: ", self.netname, " got stuck on a jumppad, trying to get out of it now\n"); self.aistatus |= AI_STATUS_OUT_JUMPPAD; + } return; } } } + else if(self.aistatus & AI_STATUS_OUT_JUMPPAD) + self.aistatus &~= AI_STATUS_OUT_JUMPPAD; // If there is a trigger_hurt right below try to use the jetpack or make a rocketjump if(skill>6) @@ -727,7 +725,7 @@ void havocbot_movetogoal() // (only when the bot is on the ground or jumping intentionally) self.aistatus &~= AI_STATUS_DANGER_AHEAD; - if(trace_fraction == 1) + if(trace_fraction == 1 && self.jumppadcount == 0) if(self.flags & FL_ONGROUND || self.aistatus & AI_STATUS_RUNNING || self.BUTTON_JUMP == TRUE) { // Look downwards