Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix barding being incorrectly marked permanently useless #4164

Conversation

WizardIke
Copy link
Contributor

Barding for races that can wear it should be marked temporarily useless in a form that melds it, not permanently useless. This was causing it to be impossible to get from acquirement and show as the wrong colour in the inventory while in a form that melds it.

Barding for races that can wear it should be marked temporarily useless
in a form that melds it, not permanently useless. This was causing it to
be impossible to get from acquirement and show as the wrong colour in
the inventory while in a form that melds it.
@WizardIke WizardIke force-pushed the fix_barding_being_perma_useless_in_forms branch from feb7a67 to fe2dc9e Compare December 9, 2024 15:48
@Implojin
Copy link
Member

Implojin commented Dec 9, 2024

Thank you for bringing this up again, because yes, you're right, there are still bugs here, but looking more deeply at the callers of can_wear_armour, I suspect some of them are incorrectly passing the desired temp bool, probably because this function is flipping the convention for temp bools used elsewhere in the code.

@Implojin
Copy link
Member

Implojin commented Dec 9, 2024

Also, I'm inclined to take the inventory highlighting as correct behavior(?), because it's being highlighted in grey while the player can't equip it.

@Implojin
Copy link
Member

Implojin commented Dec 9, 2024

Re: Your latest force push, I think we don't want to get rid of the temp check completely, because we have at least one check in invent.cc _has_temp_unwearable_armour that would be broken for bardings if we did.

(It's possible some behavior of these callers may not need to be preserved, but it does seem like it needs to be reviewed.)

@WizardIke
Copy link
Contributor Author

Also, I'm inclined to take the inventory highlighting as correct behavior(?), because it's being highlighted in grey while the player can't equip it.

It does look right, but this isn't what happens with other items like boots as only permanently useless items are greyed out in that menu.

@WizardIke
Copy link
Contributor Author

WizardIke commented Dec 10, 2024

Re: Your latest force push, I think we don't want to get rid of the temp check completely, because we have at least one check in invent.cc _has_temp_unwearable_armour that would be broken for bardings if we did.

(It's possible some behavior of these callers may not need to be preserved, but it does seem like it needs to be reviewed.)

We check for temporary things that disable wearing boots later in can_wear_armour so this check wasn't needed. It was also wrong as it would print "You can wear that only in your normal form." for boots using races. We could correct the check if that would be better, something like

if (!you.can_wear_barding(false))
{
    if (verbose)
        mprf(MSGCH_PROMPT, "You can't wear that!");
    return false;
}
else if (!ignore_temporary && !you.can_wear_barding(true)
{
    if (verbose)
        mprf(MSGCH_PROMPT, "You can wear that only in your normal form.");
    return false;
}

@WizardIke
Copy link
Contributor Author

The reworked can_equip_item function doesn't have this problem

@WizardIke WizardIke closed this Jan 29, 2025
@WizardIke WizardIke deleted the fix_barding_being_perma_useless_in_forms branch January 29, 2025 01:09
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