Whisper: Make chars with spaces work even without ""

This commit is contained in:
def 2013-08-12 23:02:39 +02:00
parent 0a5433178d
commit ed02dbed33

View file

@ -2262,6 +2262,8 @@ void CGameContext::Whisper(int ClientID, char *pStr)
pStr = str_skip_whitespaces(pStr); pStr = str_skip_whitespaces(pStr);
int Victim;
// add token // add token
if(*pStr == '"') if(*pStr == '"')
{ {
@ -2288,6 +2290,11 @@ void CGameContext::Whisper(int ClientID, char *pStr)
// write null termination // write null termination
*pStr = 0; *pStr = 0;
pStr++; pStr++;
for(Victim = 0; Victim < MAX_CLIENTS; Victim++)
if (str_comp(pName, Server()->ClientName(Victim)) == 0)
break;
} }
else else
{ {
@ -2301,6 +2308,14 @@ void CGameContext::Whisper(int ClientID, char *pStr)
} }
if(pStr[0] == ' ') if(pStr[0] == ' ')
{ {
pStr[0] = 0;
for(Victim = 0; Victim < MAX_CLIENTS; Victim++)
if (str_comp(pName, Server()->ClientName(Victim)) == 0)
break;
pStr[0] = ' ';
if (Victim < MAX_CLIENTS)
break; break;
} }
pStr++; pStr++;
@ -2320,11 +2335,6 @@ void CGameContext::Whisper(int ClientID, char *pStr)
if (!CheckClientID2(ClientID)) if (!CheckClientID2(ClientID))
return; return;
int Victim;
for(Victim = 0; Victim < MAX_CLIENTS; Victim++)
if (str_comp(pName, Server()->ClientName(Victim)) == 0)
break;
char aBuf[256]; char aBuf[256];
if (Error) if (Error)