modified colorname buffer assignment

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4109 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
ac_stef
2009-01-04 15:31:48 +00:00
parent 6b41796c15
commit b526aeda6c
4 changed files with 17 additions and 11 deletions
+3 -1
View File
@@ -53,11 +53,13 @@ bool duplicatename(playerent *d, char *name = NULL)
return false;
}
char *colorname(playerent *d, int num, char *name, const char *prefix)
char *colorname(playerent *d, char *name, const char *prefix)
{
if(!name) name = d->name;
if(name[0] && !duplicatename(d, name)) return name;
static string cname[4];
static int num = 0;
num = (num + 1) % 4;
s_sprintf(cname[num])("%s%s \fs\f6(%d)\fr", prefix, name, d->clientnum);
return cname[num];
}