fantasycalendar / FoundryVTT-ItemPiles

Other
33 stars 54 forks source link

Loot fill quantity issue with API #512

Closed dxwarlock closed 7 months ago

dxwarlock commented 8 months ago

Have you tried to reset Item Piles' system settings? Yes

Describe the bug Using the API to fill a actor with items does not act the same as using the Roll all tables option on the actors sheet

To Reproduce Use the macro game.itempiles.API.rollItemTable(table, {timesToRoll: 1,targetActor: tokens[0].actor,removeExistingActorItems: true });

And a betterrolltable table, it only populates 1 item, regardless of the better tables settings. Table settings: image What it produces image

When using the button on the actor sheet itself, it complies with the quantity options: image

Expected behavior Both should produce the same results.

Screenshots Shown above.

Setup:

Active modules: Reduced down the ones needed for itempiles and bettertables (v 1.9.3) for this scenario to test.

Haxxer commented 8 months ago

I do not personally use Better Tables, this user provided the implementation to fix it based on changes to better tables: https://github.com/fantasycalendar/FoundryVTT-ItemPiles/pull/496

Haxxer commented 8 months ago

Make sure you have fully updated BetterTables and Item Piles to their latest versions.

dxwarlock commented 8 months ago

Do I need to incorporate #496 into them manually? If I update both, I get no errors in console, but also no item generated at all on API call.

Haxxer commented 8 months ago

No - the PR is already in Item Piles - this means that either that user badly implemented their solution, or BetterTables has updated and changed their code drastically once again.

dxwarlock commented 8 months ago

Thanks, I will dig into it. It may be a BRtables issue. Thanks for the quick response time.

Haxxer commented 7 months ago

Fixed in 2.9.0