Skip to content

[lua] Fix inventory-full check blocking gil and spell rewards in avatar trials - #11088

Open
Davraena wants to merge 2 commits into
LandSandBoat:basefrom
Davraena:fix/avatar-trial-inventory-guard
Open

[lua] Fix inventory-full check blocking gil and spell rewards in avatar trials#11088
Davraena wants to merge 2 commits into
LandSandBoat:basefrom
Davraena:fix/avatar-trial-inventory-guard

Conversation

@Davraena

@Davraena Davraena commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

What does this pull request do?

The four un-migrated Trial NPCs guard their reward handling with:

if player:getFreeSlotsCount() == 0 and (option ~= 5 or option ~= 6) then 

The parenthesised check is always true, so the guard applies to every option. With a full inventory, both gil and pact rewards are refused and the player receives nothing. The quest is not completed and the Whisper key item is not consumed. The error message renders with a blank item name.

Use and so the inventory check applies only to the item rewards, which matches the already-migrated Trial_by_Fire and Trial_by_Earth.

Affects Trial by Ice (Gulmama), Wind (Agado-Pugado), Lightning (Ripapa) and Water (Edal-Tahdal).

Steps to test these changes

 !addquest OUTLANDS TRIAL_BY_WIND
 !addkeyitem WHISPER_OF_GALES
 !additem 16448 30          -- fill inventory to zero free slots
 !pos -17 7 -10 247         -- Agado-Pugado, Rabao

Talk to Agado-Pugado and select a reward.
Before: options 5 (10,000 gil) and 6 (Garuda) are both refused with You cannot obtain the . — blank item name — no reward given, quest not completed, Whisper of Gales not consumed.
After: both are granted and the quest completes normally on a full inventory.

Verified in-client on Trial by Wind; the other three NPCs are character-identical.

The four un-migrated Trial NPCs guard their reward handling with:

    if player:getFreeSlotsCount() == 0 and (option ~= 5 or option ~= 6) then

No value can differ from both 5 and 6, so the parenthesised clause is
always true and cannot affect the result. Options 5 and 6 are the 10,000
gil reward and the avatar spell, neither of which needs inventory space,
but with a full inventory both are refused and the player receives
nothing. The quest is not completed and the Whisper key item is not
consumed, so the reward is unreachable until inventory is freed. The
error message also renders with a blank item name, since `item` is still
0 on those branches.

Use `and` so the inventory check applies only to the item rewards, which
matches the already-migrated Trial_by_Fire and Trial_by_Earth: both gate
completion on whether the reward was actually granted, and neither
applies an inventory check to the gil or spell options.

Affects Trial by Ice (Gulmama), Wind (Agado-Pugado), Lightning (Ripapa)
and Water (Edal-Tahdal). Fire and Earth are already migrated to the
Interaction Framework and are unaffected.
@Davraena Davraena changed the title Fix inventory-full check blocking gil and spell rewards in avatar trials [lua] Fix inventory-full check blocking gil and spell rewards in avatar trials Aug 11, 2026
end

if player:getFreeSlotsCount() == 0 and (option ~= 5 or option ~= 6) then
if player:getFreeSlotsCount() == 0 and (option ~= 5 and option ~= 6) then

@Xaver-DaRed Xaver-DaRed Aug 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of this changes should be

if
    player:getFreeSlotsCount() == 0 and
    (option < 5 or option > 6)
then

I think its more clear this way, imo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok retested after change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants