]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
factor out stepheightvec calculation
authorRudolf Polzer <divverent@xonotic.org>
Sun, 14 Aug 2011 15:02:34 +0000 (17:02 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 14 Aug 2011 15:02:34 +0000 (17:02 +0200)
qcsrc/server/bot/bot.qc
qcsrc/server/bot/waypoints.qc

index 951d4adb67cc6e5ff8bfb93f372620b7be9b6ec5..6bcafcb99ef0135c3daf679c76b69db085730687 100644 (file)
@@ -529,6 +529,11 @@ void autoskill(float factor)
                head.totalfrags_lastcheck = head.totalfrags;
 }
 
+void bot_calculate_stepheightvec(void)
+{
+       stepheightvec = autocvar_sv_stepheight * '0 0 1';
+}
+
 void bot_serverframe()
 {
        float realplayers, bots, activerealplayers;
@@ -540,7 +545,7 @@ void bot_serverframe()
        if (time < 2)
                return;
 
-       stepheightvec = autocvar_sv_stepheight * '0 0 1';
+       bot_calculate_stepheightvec();
        bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
 
        if(time > autoskill_nextthink)
index 2fe2a09d79a2d1d5bf2beb533e35ebead738fef8..8aea49be512d0b6f7dfd42e8b5d40f73585ef73f 100644 (file)
@@ -154,7 +154,8 @@ void waypoint_think()
        local entity e;
        local vector sv, sm1, sm2, ev, em1, em2, dv;
 
-       stepheightvec = autocvar_sv_stepheight * '0 0 1';
+       bot_calculate_stepheightvec();
+
        bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
 
        //dprint("waypoint_think wpisbox = ", ftos(self.wpisbox), "\n");