0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:30:46 -05:00

Prevent Bots from Running into Airdrop Crates (!46)

Adds a `NavMeshObstacle` component to airdrop boxes at the end of `OnBoxLand`. Without this change, bots run into the crates as if they aren't there (because they're dumb).

Co-authored-by: dwesterwick <dwesterwick@yahoo.com>
Reviewed-on: SPT-AKI/Modules#46
Co-authored-by: DanW <danw@noreply.dev.sp-tarkov.com>
Co-committed-by: DanW <danw@noreply.dev.sp-tarkov.com>
This commit is contained in:
DanW 2023-12-21 22:29:49 +00:00 committed by chomp
parent 5544ae0c04
commit deecc39107
2 changed files with 11 additions and 0 deletions

View File

@ -6,6 +6,7 @@ using EFT.Airdrop;
using EFT.Interactive; using EFT.Interactive;
using EFT.SynchronizableObjects; using EFT.SynchronizableObjects;
using UnityEngine; using UnityEngine;
using UnityEngine.AI;
namespace Aki.Custom.Airdrops namespace Aki.Custom.Airdrops
{ {
@ -145,6 +146,15 @@ namespace Aki.Custom.Airdrops
Falloff = (int)surfaceSet.LandingSoundBank.Rolloff, Falloff = (int)surfaceSet.LandingSoundBank.Rolloff,
Volume = surfaceSet.LandingSoundBank.BaseVolume Volume = surfaceSet.LandingSoundBank.BaseVolume
}); });
AddNavMeshObstacle();
}
private void AddNavMeshObstacle()
{
var navMeshObstacle = this.GetOrAddComponent<NavMeshObstacle>();
navMeshObstacle.size = boxSync.CollisionCollider.bounds.size;
navMeshObstacle.carving = true;
} }
private bool RaycastBoxDistance(LayerMask layerMask, out RaycastHit hitInfo) private bool RaycastBoxDistance(LayerMask layerMask, out RaycastHit hitInfo)

View File

@ -15,6 +15,7 @@
<Reference Include="Comfort" HintPath="..\Shared\Managed\Comfort.dll" Private="False" /> <Reference Include="Comfort" HintPath="..\Shared\Managed\Comfort.dll" Private="False" />
<Reference Include="Sirenix.Serialization" HintPath="..\Shared\Managed\Sirenix.Serialization.dll" Private="False" /> <Reference Include="Sirenix.Serialization" HintPath="..\Shared\Managed\Sirenix.Serialization.dll" Private="False" />
<Reference Include="UnityEngine" HintPath="..\Shared\Managed\UnityEngine.dll" Private="False" /> <Reference Include="UnityEngine" HintPath="..\Shared\Managed\UnityEngine.dll" Private="False" />
<Reference Include="UnityEngine.AIModule" HintPath="..\Shared\Managed\UnityEngine.AIModule.dll" Private="False" />
<Reference Include="UnityEngine.AnimationModule" HintPath="..\Shared\Managed\UnityEngine.AnimationModule.dll" Private="False" /> <Reference Include="UnityEngine.AnimationModule" HintPath="..\Shared\Managed\UnityEngine.AnimationModule.dll" Private="False" />
<Reference Include="UnityEngine.AssetBundleModule" HintPath="..\Shared\Managed\UnityEngine.AssetBundleModule.dll" Private="False" /> <Reference Include="UnityEngine.AssetBundleModule" HintPath="..\Shared\Managed\UnityEngine.AssetBundleModule.dll" Private="False" />
<Reference Include="UnityEngine.AudioModule" HintPath="..\Shared\Managed\UnityEngine.AudioModule.dll" Private="False" /> <Reference Include="UnityEngine.AudioModule" HintPath="..\Shared\Managed\UnityEngine.AudioModule.dll" Private="False" />