From: Rudolf Polzer Date: Sun, 14 Aug 2011 15:02:34 +0000 (+0200) Subject: factor out stepheightvec calculation X-Git-Tag: xonotic-v0.5.0~148^2~9 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8a262d988dcb3e1f6872511738dd9f6ade460bd4;p=xonotic%2Fxonotic-data.pk3dir.git factor out stepheightvec calculation --- diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/bot.qc index 951d4adb6..6bcafcb99 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -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) diff --git a/qcsrc/server/bot/waypoints.qc b/qcsrc/server/bot/waypoints.qc index 2fe2a09d7..8aea49be5 100644 --- a/qcsrc/server/bot/waypoints.qc +++ b/qcsrc/server/bot/waypoints.qc @@ -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");