From 518829f6b829dcca916c17905ac2ed53aa81fd85 Mon Sep 17 00:00:00 2001 From: Sweet Date: Thu, 15 Feb 2024 14:09:47 +0100 Subject: [PATCH] alien bots: do not chase players when attacked by turrets --- src/sgame/sg_bot_util.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/sgame/sg_bot_util.cpp b/src/sgame/sg_bot_util.cpp index b816c4be926..974de78d974 100644 --- a/src/sgame/sg_bot_util.cpp +++ b/src/sgame/sg_bot_util.cpp @@ -2493,6 +2493,17 @@ static gentity_t *BotPopEnemy( enemyQueue_t *queue ) void BotPain( gentity_t *self, gentity_t *attacker, int ) { + // alien bots should not chase human players when attacked by turrets + if ( G_Team( self ) == TEAM_ALIENS + && G_Team( attacker ) != TEAM_NONE + && attacker->s.modelindex == BA_H_MGTURRET + && self->botMind->goal.targetsValidEntity() + && self->botMind->goal.getTargetedEntity()->s.eType == entityType_t::ET_PLAYER ) + { + BotChangeGoalEntity( self, self ); // reset goal + return; + } + if ( G_Team( attacker ) != TEAM_NONE && !G_OnSameTeam( self, attacker ) && attacker->s.eType == entityType_t::ET_PLAYER