(050157f65) Fix bots not being able to use buttons or ladders because the were aiming. Don't aim when farther than 500 pixels away from the target.
This commit is contained in:
+19
-1
@@ -3,6 +3,7 @@ using FarseerPhysics;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Barotrauma.Extensions;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -95,7 +96,24 @@ namespace Barotrauma
|
||||
character.CursorPosition = fs.Position;
|
||||
if (extinguisher.Item.RequireAimToUse)
|
||||
{
|
||||
character.SetInput(InputType.Aim, false, true);
|
||||
bool isOperatingButtons = false;
|
||||
if (SteeringManager == PathSteering)
|
||||
{
|
||||
var door = PathSteering.CurrentPath?.CurrentNode?.ConnectedDoor;
|
||||
if (door != null && !door.IsOpen)
|
||||
{
|
||||
var buttons = door.Item.GetComponents<Controller>();
|
||||
if (buttons.None())
|
||||
{
|
||||
buttons = door.Item.GetConnectedComponents<Controller>(true);
|
||||
}
|
||||
isOperatingButtons = buttons.Any();
|
||||
}
|
||||
}
|
||||
if (!isOperatingButtons)
|
||||
{
|
||||
character.SetInput(InputType.Aim, false, true);
|
||||
}
|
||||
}
|
||||
Limb sightLimb = null;
|
||||
if (character.Inventory.IsInLimbSlot(extinguisherItem, InvSlotType.RightHand))
|
||||
|
||||
Reference in New Issue
Block a user