From 8a262d988dcb3e1f6872511738dd9f6ade460bd4 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sun, 14 Aug 2011 17:02:34 +0200 Subject: [PATCH] factor out stepheightvec calculation --- qcsrc/server/bot/bot.qc | 7 ++++++- qcsrc/server/bot/waypoints.qc | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) 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"); -- 2.39.2