diff --git a/src/game/server/server_tf.vpc b/src/game/server/server_tf.vpc index 427c93d6f24..0e9d523c6f2 100644 --- a/src/game/server/server_tf.vpc +++ b/src/game/server/server_tf.vpc @@ -524,6 +524,8 @@ $Project "Server (TF)" $File "tf\bot\behavior\tf_bot_melee_attack.h" $File "tf\bot\behavior\tf_bot_approach_object.cpp" $File "tf\bot\behavior\tf_bot_approach_object.h" + $File "tf\bot\behavior\tf_bot_freeze_input.cpp" + $File "tf\bot\behavior\tf_bot_freeze_input.h" $File "tf\bot\behavior\tf_bot_get_health.cpp" $File "tf\bot\behavior\tf_bot_get_health.h" $File "tf\bot\behavior\tf_bot_get_ammo.cpp" @@ -541,7 +543,7 @@ $Project "Server (TF)" $File "tf\bot\behavior\tf_bot_escort.cpp" $File "tf\bot\behavior\tf_bot_escort.h" $File "tf\bot\behavior\tf_bot_use_item.cpp" - $File "tf\bot\behavior\tf_bot_use_item.h" + $File "tf\bot\behavior\tf_bot_use_item.h" $File "tf\bot\behavior\tf_bot_mvm_deploy_bomb.cpp" $File "tf\bot\behavior\tf_bot_mvm_deploy_bomb.h" diff --git a/src/game/server/tf/bot/behavior/tf_bot_behavior.cpp b/src/game/server/tf/bot/behavior/tf_bot_behavior.cpp index 6f41fd7aa76..f9918cc981d 100644 --- a/src/game/server/tf/bot/behavior/tf_bot_behavior.cpp +++ b/src/game/server/tf/bot/behavior/tf_bot_behavior.cpp @@ -20,6 +20,7 @@ #include "bot/tf_bot_manager.h" #include "bot/behavior/tf_bot_behavior.h" #include "bot/behavior/tf_bot_dead.h" +#include "bot/behavior/tf_bot_freeze_input.h" #include "NextBot/NavMeshEntities/func_nav_prerequisite.h" #include "bot/behavior/nav_entities/tf_bot_nav_ent_destroy_entity.h" #include "bot/behavior/nav_entities/tf_bot_nav_ent_move_to.h" @@ -106,6 +107,12 @@ ActionResult< CTFBot > CTFBotMainAction::Update( CTFBot *me, float interval ) return Done( "Not on a playing team" ); } + if ( me->m_Shared.InCond( TF_COND_FREEZE_INPUT ) || me->m_Shared.InCond( TF_COND_HALLOWEEN_THRILLER ) ) + { + // frozen - do nothing + return SuspendFor( new CTFBotFreezeInput, "Frozen by TF_COND" ); + } + // Should I accept taunt from my partner? if ( me->FindPartnerTauntInitiator() ) { diff --git a/src/game/server/tf/bot/behavior/tf_bot_freeze_input.cpp b/src/game/server/tf/bot/behavior/tf_bot_freeze_input.cpp new file mode 100644 index 00000000000..a4242706a8c --- /dev/null +++ b/src/game/server/tf/bot/behavior/tf_bot_freeze_input.cpp @@ -0,0 +1,20 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// tf_bot_freeze_input.cpp +// Don't do anything until the TF_COND_FREEZE_INPUT condition expires +// Community-contributed, June 2025 + +#include "cbase.h" +#include "bot/tf_bot.h" +#include "bot/behavior/tf_bot_freeze_input.h" + + +//--------------------------------------------------------------------------------------------- +ActionResult< CTFBot > CTFBotFreezeInput::Update( CTFBot *me, float interval ) +{ + if ( !me->m_Shared.InCond( TF_COND_FREEZE_INPUT ) && !me->m_Shared.InCond( TF_COND_HALLOWEEN_THRILLER ) ) + { + return Done( "No longer frozen by TF_COND" ); + } + + return Continue(); +} diff --git a/src/game/server/tf/bot/behavior/tf_bot_freeze_input.h b/src/game/server/tf/bot/behavior/tf_bot_freeze_input.h new file mode 100644 index 00000000000..6e78c4eec87 --- /dev/null +++ b/src/game/server/tf/bot/behavior/tf_bot_freeze_input.h @@ -0,0 +1,20 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// tf_bot_freeze_input.h +// Don't do anything until the TF_COND_FREEZE_INPUT condition expires +// Community-contributed, June 2025 + +#ifndef TF_BOT_FREEZE_INPUT_H +#define TF_BOT_FREEZE_INPUT_H + + +//----------------------------------------------------------------------------- +class CTFBotFreezeInput : public Action< CTFBot > +{ +public: + virtual ActionResult< CTFBot > Update( CTFBot *me, float interval ); + + virtual const char *GetName( void ) const { return "FreezeInput"; }; +}; + + +#endif // TF_BOT_FREEZE_INPUT_H