Skip to content

Iter_Remove is failing/not working on custom array of iterators #19

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

Open
hiwyn opened this issue Jan 17, 2024 · 2 comments
Open

Iter_Remove is failing/not working on custom array of iterators #19

hiwyn opened this issue Jan 17, 2024 · 2 comments

Comments

@hiwyn
Copy link

hiwyn commented Jan 17, 2024

Iter_Remove is failing/not working on custom array of iterators

public OnPlayerDisconnect(playerid, reason) {
       new facid = fmember[playerid];
        if(facid > 0) {
            Iter_Remove(FactionMembers_List[facid], playerid);
        }
}

but the player id stills on the facid list

@ziggi
Copy link
Member

ziggi commented Jan 17, 2024

Show output with this:

public OnPlayerDisconnect(playerid, reason) {
    new facid = fmember[playerid];
    if (facid > 0) {
        foreach (new id : FactionMembers_List[facid]) {
            printf("BEFORE playerid = %d", id);
        }

        Iter_Remove(FactionMembers_List[facid], playerid);

        foreach (new id : FactionMembers_List[facid]) {
            printf("AFTER playerid = %d", id);
        }
    }
}

@0z0sk0
Copy link

0z0sk0 commented Feb 20, 2025

same for Iter_Clear in OnPlayerDisconnect

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

No branches or pull requests

3 participants