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

[lua] Correct isValidEntry logic to trade for registration #5615

Merged
merged 1 commit into from
May 4, 2024

Conversation

MowFord
Copy link
Contributor

@MowFord MowFord commented May 4, 2024

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?

Closes #5613 .

The isValidEntry logic was referencing the battlefield entryNpc value (which never explicitly gets set, it gets passed and used to build a table of one entry for entryNpcs) instead of the traded npc's name

Steps to test these changes

Give yourself all the key items and items and trade the 4 chips to the swirling vortex

Xaver-DaRed
Xaver-DaRed previously approved these changes May 4, 2024
Copy link
Member

@WinterSolstice8 WinterSolstice8 left a comment

Choose a reason for hiding this comment

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

Makes sense, apollyon has multiple entrances for this

@@ -26,7 +26,7 @@ local content = Limbus:new({
})

function content:isValidEntry(player, npc)
return self.entryNpc == '_12i' or self.entryNpc == '_127'
return npc and (npc:getName() == '_12i' or npc:getName() == '_127')
Copy link
Contributor

@claywar claywar May 4, 2024

Choose a reason for hiding this comment

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

for _, npcName in self.entryNpcs do
    if npc:getName == npcName then
        return true
    end

    return false
end

Copy link
Contributor

Choose a reason for hiding this comment

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

entryNpcs is a table, entryNpc on construct is now converted to a table, so this was a miss on my part

Copy link
Contributor

Choose a reason for hiding this comment

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

Also set entryNpcs in the constructor to { '_12i, '_127' }

Copy link
Contributor

Choose a reason for hiding this comment

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

Most likely now that I think of it, you won't even need the entry function in this BCNM

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it, so for both we just need to remove the isvalidentry override and defined entryNpcs in their constructors?

Copy link
Contributor

@claywar claywar May 4, 2024

Choose a reason for hiding this comment

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

I believe so. Sorry for the mixed info as I was thinking through things, but yeah, that should work on its own. Added support for multiple entrances with Divine Might, so the same logic should work here I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, simpler logic and it works.

Really love the new battlefield content structure. Easy to module changes, cleaner format, more things in one place

@Xaver-DaRed Xaver-DaRed dismissed their stale review May 4, 2024 19:42

Dismissed because I wrongly assumed the system didn't support multiple entrances

Copy link
Member

@WinterSolstice8 WinterSolstice8 left a comment

Choose a reason for hiding this comment

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

A lot more elegant

@claywar claywar merged commit 34ab38b into LandSandBoat:base May 4, 2024
11 checks passed
@CatsEyeXI CatsEyeXI deleted the apollyon_entry branch May 13, 2024 02:39
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.

🐛 Central Apollyon entry
4 participants