diff --git a/.vs/SAIN/FileContentIndex/2bcc97c1-1cc8-4e95-99ca-630a2f994d18.vsidx b/.vs/SAIN/FileContentIndex/2bcc97c1-1cc8-4e95-99ca-630a2f994d18.vsidx new file mode 100644 index 000000000..4ee61ea27 Binary files /dev/null and b/.vs/SAIN/FileContentIndex/2bcc97c1-1cc8-4e95-99ca-630a2f994d18.vsidx differ diff --git a/.vs/SAIN/FileContentIndex/9077998e-12b6-43f4-9a0e-c7c976ebe3bd.vsidx b/.vs/SAIN/FileContentIndex/9077998e-12b6-43f4-9a0e-c7c976ebe3bd.vsidx deleted file mode 100644 index 5462e41ec..000000000 Binary files a/.vs/SAIN/FileContentIndex/9077998e-12b6-43f4-9a0e-c7c976ebe3bd.vsidx and /dev/null differ diff --git a/.vs/SAIN/v17/.suo b/.vs/SAIN/v17/.suo index 8a3cf5470..45796db2d 100644 Binary files a/.vs/SAIN/v17/.suo and b/.vs/SAIN/v17/.suo differ diff --git a/Components/Bot Components/Classes/CombatFunctions/ShootClass.cs b/Components/Bot Components/Classes/CombatFunctions/ShootClass.cs index e086de633..4a7ec476a 100644 --- a/Components/Bot Components/Classes/CombatFunctions/ShootClass.cs +++ b/Components/Bot Components/Classes/CombatFunctions/ShootClass.cs @@ -1,10 +1,7 @@ -using EFT; -using System; +using Aki.Reflection.Patching; +using EFT; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnityEngine.UIElements; +using UnityEngine; namespace SAIN.Classes.CombatFunctions { @@ -27,10 +24,41 @@ public void Update() if (SAIN.Enemy.IsVisible && FriendlyFire.ClearShot) { + if (NoBushESP(SAIN.Enemy.Person)) + { + FriendlyFire.StopShooting(); + return; + } Shoot.Update(); } } + private static LayerMask NoBushMask => LayerMaskClass.HighPolyWithTerrainMaskAI; + + private bool NoBushESP(IAIDetails person) + { + if (person.GetPlayer.IsYourPlayer) + { + Vector3 start = SAIN.HeadPosition; + Vector3 direction = person.MainParts[BodyPartType.body].Position - start; + if (Physics.Raycast(start, direction, out var hitInfo, direction.magnitude, NoBushMask)) + { + string ObjectName = hitInfo.transform.parent?.gameObject?.name; + foreach (string exclusion in ExclusionList) + { + if (ObjectName.ToLower().Contains(exclusion)) + { + return true; + } + } + } + } + return false; + } + + public static List ExclusionList = new List { "filbert", "fibert", "tree", "pine", "plant", "birch", "collider", + "timber", "spruce", "bush", "metal", "wood"}; + public FriendlyFireClass FriendlyFire { get; private set; } private readonly GClass105 Shoot; } diff --git a/bin/x86/3.5.7/SAIN.dll b/bin/x86/3.5.7/SAIN.dll index b3c9eb3d8..523761faa 100644 Binary files a/bin/x86/3.5.7/SAIN.dll and b/bin/x86/3.5.7/SAIN.dll differ diff --git a/bin/x86/3.5.7/SAIN.pdb b/bin/x86/3.5.7/SAIN.pdb index 51591d842..58e21f6c5 100644 Binary files a/bin/x86/3.5.7/SAIN.pdb and b/bin/x86/3.5.7/SAIN.pdb differ diff --git a/obj/x86/3.5.7/SAIN.csproj.AssemblyReference.cache b/obj/x86/3.5.7/SAIN.csproj.AssemblyReference.cache index 829c8e23a..f20b4fe1b 100644 Binary files a/obj/x86/3.5.7/SAIN.csproj.AssemblyReference.cache and b/obj/x86/3.5.7/SAIN.csproj.AssemblyReference.cache differ diff --git a/obj/x86/3.5.7/SAIN.dll b/obj/x86/3.5.7/SAIN.dll index b3c9eb3d8..523761faa 100644 Binary files a/obj/x86/3.5.7/SAIN.dll and b/obj/x86/3.5.7/SAIN.dll differ diff --git a/obj/x86/3.5.7/SAIN.pdb b/obj/x86/3.5.7/SAIN.pdb index 51591d842..58e21f6c5 100644 Binary files a/obj/x86/3.5.7/SAIN.pdb and b/obj/x86/3.5.7/SAIN.pdb differ