aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/server/functorutils.h
diff options
context:
space:
mode:
Diffstat (limited to 'mp/src/game/server/functorutils.h')
-rw-r--r--mp/src/game/server/functorutils.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/mp/src/game/server/functorutils.h b/mp/src/game/server/functorutils.h
index 8b4657b2..d07f0597 100644
--- a/mp/src/game/server/functorutils.h
+++ b/mp/src/game/server/functorutils.h
@@ -5,8 +5,10 @@
#ifndef _FUNCTOR_UTILS_H_
#define _FUNCTOR_UTILS_H_
+#ifdef NEXT_BOT
#include "NextBotInterface.h"
#include "NextBotManager.h"
+#endif // NEXT_BOT
//--------------------------------------------------------------------------------------------------------
/**
@@ -321,12 +323,14 @@ inline bool ForEachActor( Functor &func )
if ( !player->IsConnected() )
continue;
+#ifdef NEXT_BOT
// skip bots - ForEachCombatCharacter will catch them
INextBot *bot = player->MyNextBotPointer();
if ( bot )
{
continue;
}
+#endif // NEXT_BOT
if ( func( player ) == false )
{
@@ -334,8 +338,12 @@ inline bool ForEachActor( Functor &func )
}
}
+#ifdef NEXT_BOT
// iterate all NextBots
return TheNextBots().ForEachCombatCharacter( func );
+#else
+ return true;
+#endif // NEXT_BOT
}
@@ -385,12 +393,14 @@ inline bool ForEachActor( IActorFunctor &func )
if ( !player->IsConnected() )
continue;
+#ifdef NEXT_BOT
// skip bots - ForEachCombatCharacter will catch them
INextBot *bot = dynamic_cast< INextBot * >( player );
if ( bot )
{
continue;
}
+#endif // NEXT_BOT
if ( func( player ) == false )
{
@@ -399,11 +409,13 @@ inline bool ForEachActor( IActorFunctor &func )
}
}
+#ifdef NEXT_BOT
if ( !isComplete )
{
// iterate all NextBots
isComplete = TheNextBots().ForEachCombatCharacter( func );
}
+#endif // NEXT_BOT
func.OnEndIteration( isComplete );