Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: fixed the usage of items.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 12, 2023
1 parent 226536b commit a03555d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions RotationSolver.Basic/Actions/BaseItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ internal class BaseItem : IBaseItem
public uint AdjustedID => ID;

public Func<bool> OtherCheck { private get; set; }
private unsafe bool HasIt => InventoryManager.Instance()->GetInventoryItemCount(_item.RowId, false) > 0 ||
InventoryManager.Instance()->GetInventoryItemCount(_item.RowId, true) > 0;
private unsafe bool HasIt => InventoryManager.Instance()->GetInventoryItemCount(ID, false) > 0 ||
InventoryManager.Instance()->GetInventoryItemCount(ID, true) > 0;

public uint IconID { get; }

Expand Down Expand Up @@ -73,12 +73,12 @@ public BaseItem(uint row, uint a4 = 65535)
public unsafe bool CanUse(out IAction item)
{
item = this;

if (_item == null) return false;

if (!Service.Config.UseItem) return false;

if (ConfigurationHelper.BadStatus.Contains(ActionManager.Instance()->GetActionStatus(ActionType.Item, ID))) return false;
if (ConfigurationHelper.BadStatus.Contains(ActionManager.Instance()->GetActionStatus(ActionType.Item, ID))
&& ConfigurationHelper.BadStatus.Contains(ActionManager.Instance()->GetActionStatus(ActionType.Item, ID + 1000000))) return false;

var remain = RecastTimeOneCharge - RecastTimeElapsed;

Expand All @@ -93,12 +93,12 @@ public unsafe bool Use()
{
if (_item == null) return false;

if (InventoryManager.Instance()->GetInventoryItemCount(_item.RowId, true) > 0)
if (InventoryManager.Instance()->GetInventoryItemCount(ID, true) > 0)
{
return ActionManager.Instance()->UseAction(ActionType.Item, _item.RowId + 1000000, Service.Player.ObjectId, A4);
return ActionManager.Instance()->UseAction(ActionType.Item, ID + 1000000, Service.Player.ObjectId, A4);
}

return ActionManager.Instance()->UseAction(ActionType.Item, _item.RowId, Service.Player.ObjectId, A4);
return ActionManager.Instance()->UseAction(ActionType.Item, ID, Service.Player.ObjectId, A4);
}

public override string ToString() => Name;
Expand Down

0 comments on commit a03555d

Please sign in to comment.