Actually, I just checked my sp against the one in the first post, and it mine is the fixed one. Here's what's changed
Code:
while(moreKeys)
{
new String:channelName[64], String:channelType[32], ChannelType:channelTypenum;
KvGetSectionName(channelKV, channelName, sizeof(channelName));
KvGetString(channelKV, "type", channelType, sizeof(channelType), "IRC_CHANNEL_PUBLIC");
if(!strcmp(channelType, "IRC_CHANNEL_PUBLIC"))
channelTypenum = IRC_CHANNEL_PUBLIC; // 1
else if(!strcmp(channelType, "IRC_CHANNEL_PRIVATE"))
channelTypenum = IRC_CHANNEL_PRIVATE; // 2
PushArrayString(g_ChannelNames, channelName);
PushArrayCell(g_ChannelTypes, channelTypenum);
moreKeys = KvGotoNextKey(channelKV);
}
Code:
while(moreKeys)
{
new String:channelName[64], String:channelType[32], ChannelType:channelTypenum;
KvGetSectionName(channelKV, channelName, sizeof(channelName));
KvGetString(channelKV, "type", channelType, sizeof(channelType), "IRC_CHANNEL_PUBLIC");
if(FindStringInArray(g_ChannelNames, channelName) != -1)
{
moreKeys = KvGotoNextKey(channelKV);
continue;
}
if(!strcmp(channelType, "IRC_CHANNEL_PUBLIC"))
channelTypenum = IRC_CHANNEL_PUBLIC; // 1
else if(!strcmp(channelType, "IRC_CHANNEL_PRIVATE"))
channelTypenum = IRC_CHANNEL_PRIVATE; // 2
PushArrayString(g_ChannelNames, channelName);
PushArrayCell(g_ChannelTypes, channelTypenum);
moreKeys = KvGotoNextKey(channelKV);
}
It's around line 1119 in the core sp file
What this does is check if the currently joined channel(s) are in the channel array, and doesn't re-add them if it is.