MCPcopy Create free account
hub / github.com/assaultcube/AC / getclientskin

Function getclientskin

source/src/rendermodel.cpp:1026–1047  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1024static vector<char *> playerskinlist;
1025
1026const char *getclientskin(const char *name, const char *suf)
1027{
1028 static string tmp;
1029 int suflen = (int)strlen(suf), namelen = (int)strlen(name);
1030 const char *s, *r = NULL;
1031 loopv(playerskinlist)
1032 {
1033 s = playerskinlist[i];
1034 int sl = (int)strlen(s) - suflen;
1035 if(sl > 0 && !strcmp(s + sl, suf))
1036 {
1037 if(namelen == sl && !strncmp(name, s, namelen)) return s; // exact match
1038 if(s[sl - 1] == '_')
1039 {
1040 copystring(tmp, s);
1041 tmp[sl - 1] = '\0';
1042 if(strstr(name, tmp)) r = s; // partial match
1043 }
1044 }
1045 }
1046 return r;
1047}
1048
1049void updateclientname(playerent *d)
1050{

Callers 1

updateclientnameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected