diff --git a/src/game/server/NextBot/NextBotVisionInterface.cpp b/src/game/server/NextBot/NextBotVisionInterface.cpp index 8fa12e02c5..9523fbdfbe 100644 --- a/src/game/server/NextBot/NextBotVisionInterface.cpp +++ b/src/game/server/NextBot/NextBotVisionInterface.cpp @@ -723,13 +723,22 @@ bool IVision::IsLineOfSightClear( const Vector &pos ) const bool IVision::IsLineOfSightClearToEntity( const CBaseEntity *subject, Vector *visibleSpot ) const { #ifdef NEO - // Special case for Support-class bots to see through smoke - bool isSupport = false; + bool canSeeThroughSmoke = false; if (auto player = ToNEOPlayer(GetBot()->GetEntity())) { - isSupport = (player->GetClass() == NEO_CLASS_SUPPORT); + // Bot has thermal vision as a Support class + canSeeThroughSmoke = (player->GetClass() == NEO_CLASS_SUPPORT); } - ScopedSmokeLOS smokeGuard(isSupport); + if (!canSeeThroughSmoke) + { + const auto *pSubjectPlayer = ToNEOPlayer(subject); + if (pSubjectPlayer && pSubjectPlayer->IsCarryingGhost()) + { + // Ghoster is always visible through smoke + canSeeThroughSmoke = true; + } + } + ScopedSmokeLOS smokeGuard(canSeeThroughSmoke); #endif #ifdef TERROR diff --git a/src/game/server/neo/neo_player.h b/src/game/server/neo/neo_player.h index 6deeb2256a..5114d19229 100644 --- a/src/game/server/neo/neo_player.h +++ b/src/game/server/neo/neo_player.h @@ -377,4 +377,13 @@ inline CNEO_Player *ToNEOPlayer(CBaseEntity *pEntity) return assert_cast(pEntity); } +inline const CNEO_Player *ToNEOPlayer(const CBaseEntity *pEntity) +{ + if (!pEntity || !pEntity->IsPlayer()) + { + return nullptr; + } + return assert_cast(pEntity); +} + #endif // NEO_PLAYER_H