Skip to content

Commit

Permalink
don't use IsShopOpen for non gilshops
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaksuhn committed Jan 16, 2025
1 parent 6f33f07 commit c22618f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Automaton/Tasks/BuyCeruleumTanks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@ protected override async Task Execute()

Status = $"Moving to {npc.Location}";
await MoveToDirectly(npc.Location, 0.5f);
await BuyFromFccShop(MammetVoyagerENpcId, npc!.ShopId, CeruleumTankId, 999 - Inventory.GetItemCount(CeruleumTankId, false), Game.ShopType.FreeCompanyCreditShop);
await BuyFromFccShop(MammetVoyagerENpcId, npc!.ShopId, CeruleumTankId, 999 - Inventory.GetItemCount(CeruleumTankId, false);

Check failure on line 19 in Automaton/Tasks/BuyCeruleumTanks.cs

View workflow job for this annotation

GitHub Actions / Build

) expected

Check failure on line 19 in Automaton/Tasks/BuyCeruleumTanks.cs

View workflow job for this annotation

GitHub Actions / Build

) expected
}

private async Task BuyFromFccShop(ulong vendorInstanceId, uint shopId, uint itemId, int count, Game.ShopType shopType = Game.ShopType.None)
private async Task BuyFromFccShop(ulong vendorInstanceId, uint shopId, uint itemId, int count)
{
using var scope = BeginScope("Buy");
Status = "Opening shop";
if (!Game.IsShopOpen(shopId, shopType))
if (!Game.AddonActive("FreeCompanyCreditShop"))
{
Log("Opening shop...");
ErrorIf(!Game.OpenShop(vendorInstanceId, shopId), $"Failed to open shop {vendorInstanceId:X}.{shopId:X}");
await WaitWhile(() => !Game.IsShopOpen(shopId, shopType), "WaitForOpen");
await WaitWhile(() => !Game.AddonActive("FreeCompanyCreditShop"), "WaitForFCCShop");
await WaitWhile(() => !Svc.Condition[ConditionFlag.OccupiedInEvent], "WaitForCondition");
}
await WaitWhile(() => !Game.AddonActive("FreeCompanyCreditShop"), "WaitForFCCShop");

Log("Buying...");
if (TryGetAddonMaster<AddonMaster.FreeCompanyCreditShop>(out var am))
Expand Down

0 comments on commit c22618f

Please sign in to comment.