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

Clear the mob's party when removing a party member #6222

Merged
merged 1 commit into from
Sep 7, 2024

Conversation

jmcmorris
Copy link
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?

When removing a party member from a mob party the party member's PParty would not be set to nullptr. This would cause it to not be allowed to be added to other parties.

Steps to test these changes

I was testing this with #6214 with the local change of the Shiva WTB battlefield having this:

content.groups =
{
    {
        mobs = { 'Shiva_Prime_WTB' },
        death = function(battlefield, mob)
            -- when avatar defeated then all elementals should also die
            for i = 1, 4 do
                local elemental = GetMobByID(mob:getID() + i)
                if elemental and elemental:isAlive() then
                    elemental:setHP(0)
                end
            end

            battlefield:setStatus(xi.battlefield.status.WON)
        end,
    },

    {
        mobs =
        {
            'Shiva_Prime_WTB',
            'Ice_Elemental',
        },
        isParty   = true,
        superlink = true,
    },
}

With these changes Shiva Prime and the Ice Elementals should link properly due to them being in a party together. Without the change in party.cpp they do not get added to a party together.

Copy link
Contributor

@claywar claywar left a comment

Choose a reason for hiding this comment

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

The other option here, since there's not a way to define some mobs twice in all scenarios (say, only the prime is required to kill, but elementals not), would be to set the same superlinkGroup for each defined content group. Same group across requirements will superlink in that scenario (I want to say it just takes the upper half of superlink numbers and assigns a unique value on BCNM start)

@claywar claywar merged commit b77fe93 into LandSandBoat:base Sep 7, 2024
13 checks passed
@jmcmorris jmcmorris deleted the mob_party_clear branch September 8, 2024 02:11
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.

3 participants