Iter_Remove is failing/not working on custom array of iterators
hiwyn opened this issue · comments
hiwyn commented
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
Sergei Marochkin commented
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);
}
}
}