diff --git a/src/g_cmds.c b/src/g_cmds.c index 58586b4..47133a6 100644 --- a/src/g_cmds.c +++ b/src/g_cmds.c @@ -27,11 +27,10 @@ #include "header/local.h" #include "monster/player.h" -char * -ClientTeam(edict_t *ent) +static char * +ClientTeam(edict_t *ent, char* value) { char *p; - static char value[512]; value[0] = 0; @@ -68,10 +67,10 @@ OnSameTeam(edict_t *ent1, edict_t *ent2) return false; } - strcpy(ent1Team, ClientTeam(ent1)); - strcpy(ent2Team, ClientTeam(ent2)); + ClientTeam(ent1, ent1Team); + ClientTeam(ent2, ent2Team); - if (strcmp(ent1Team, ent2Team) == 0) + if (ent1Team[0] != '\0' && strcmp(ent1Team, ent2Team) == 0) { return true; }