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

[GH-467] Unequip previously equipped item on equip #689

Conversation

lotuuu
Copy link
Contributor

@lotuuu lotuuu commented Jun 7, 2024

Motivation

Items of the same type were not being unequipped when a unit equipped another one. We marked this as a bug instead of a feature because we thought it was already inclemented, but it seems like we just never actually did it.
Closes lambdaclass/afk_gacha_game#467

Summary of changes

  • Create new equip item function that also unequips the previous item
  • Fix a small warning in Items
  • Add tests for this

How to test it?

Create two items, or use the ones you gain by winning the first few levels of the campaign. Equip one of them to a unit. Then equip the other one (of the same type). Query the initial one, and you should see that its' unit_id is nil

@lotuuu lotuuu marked this pull request as ready for review June 7, 2024 19:58
@lotuuu lotuuu self-assigned this Jun 7, 2024
@lotuuu lotuuu added the autobattler AFK Gacha Autobattler game label Jun 7, 2024
agustinesco
agustinesco previously approved these changes Jun 12, 2024
Copy link
Contributor

@agustinesco agustinesco left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autobattler AFK Gacha Autobattler game freeze
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Many items of the same type can be equipped to the same unit
3 participants