Skip to content

Commit

Permalink
Merge pull request #703 from Elypha/pr-1
Browse files Browse the repository at this point in the history
fix npc talk loop
  • Loading branch information
erdelf authored Dec 20, 2024
2 parents d30d1ab + 7132380 commit d6914aa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions AutoDuty/Managers/ActionsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void InvokeAction(PathAction action)
Svc.Log.Error(ex.ToString());
}
}

public void Follow(PathAction action) => FollowHelper.SetFollow(GetObjectByName(action.Arguments[0]));

public void SetBMSettings(PathAction action) => Plugin.SetBMSettings(bool.TryParse(action.Arguments[0], out bool defaultsettings) && defaultsettings);
Expand Down Expand Up @@ -101,7 +101,7 @@ public unsafe void ConditionAction(PathAction action)
};
var operatorValue = string.Empty;
var operationResult = false;

switch (conditionArray[0])
{
case "GetDistanceToPlayer":
Expand Down Expand Up @@ -406,7 +406,7 @@ private unsafe bool InteractableCheck(IGameObject? gameObject)
if (gameObject == null || !gameObject.IsTargetable || !gameObject.IsValid() || !IsValid)
return true;

if (EzThrottler.Throttle("Interactable", 250))
if (EzThrottler.Throttle("Interactable", 1000))
{
if (!TryGetObjectByDataId(gameObject?.DataId ?? 0, out gameObject)) return true;

Expand Down Expand Up @@ -474,7 +474,7 @@ public unsafe void Interactable(PathAction action)
dataIds.Add(TryGetObjectIdRegex(action.Arguments[0], out objectDataId) ? (uint.TryParse(objectDataId, out var dataId) ? dataId : 0) : 0);

if (dataIds.All(x => x.Equals("0"))) return;

IGameObject? gameObject = null;
Plugin.Action = $"Interactable";
_taskManager.Enqueue(() => Player.Character->InCombat || (gameObject = Svc.Objects.Where(x => x.DataId.EqualsAny(dataIds) && x.IsTargetable).OrderBy(GetDistanceToPlayer).FirstOrDefault()) != null, "Interactable-GetGameObjectUnlessInCombat");
Expand Down Expand Up @@ -550,7 +550,7 @@ public void Boss(PathAction action)
_taskManager.Enqueue(() => BossCheck(), int.MaxValue, "Boss-BossCheck");
_taskManager.Enqueue(() => { Plugin.StopForCombat = true; }, "Boss-SetStopForCombatTrue");
_taskManager.Enqueue(() => { Plugin.BossObject = null; }, "Boss-ClearBossObject");

if (Plugin.Configuration.LootTreasure)
{
_taskManager.DelayNext("Boss-TreasureDelay", 1000);
Expand Down

0 comments on commit d6914aa

Please sign in to comment.