Created
October 18, 2012 15:30
-
-
Save HarpyWar/3912580 to your computer and use it in GitHub Desktop.
Clan tag is case-sensitive in 1.8.5 and case-insensitive in 1.99
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern t_clan *clanlist_find_clan_by_clantag(int clantag) | |
{ | |
t_elem *curr; | |
t_clan *clan; | |
if (clantag == 0) | |
return NULL; | |
if (clanlist_head) | |
{ | |
LIST_TRAVERSE(clanlist_head, curr) | |
{ | |
if (!(clan = elem_get_data(curr))) | |
{ | |
eventlog(eventlog_level_error, __FUNCTION__, "found NULL entry in list"); | |
continue; | |
} | |
if (clan->created && (clan->clantag == clantag)) | |
return clan; | |
} | |
} | |
return NULL; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern t_clan *clanlist_find_clan_by_clantag(t_clantag clantag) | |
{ | |
t_elem *curr; | |
t_clan *clan; | |
char * needle; | |
if (clantag == 0) | |
return NULL; | |
needle = xstrdup(clantag_to_str(clantag)); | |
if (clanlist_head) | |
{ | |
LIST_TRAVERSE(clanlist_head, curr) | |
{ | |
if (!(clan = (t_clan*)elem_get_data(curr))) | |
{ | |
eventlog(eventlog_level_error, __FUNCTION__, "found NULL entry in list"); | |
continue; | |
} | |
if (clan->created && !strcasecmp(needle, clantag_to_str(clan->tag))) { | |
xfree(needle); | |
return clan; | |
} | |
} | |
} | |
xfree(needle); | |
return NULL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment