moved sanitizestring to g_util

This commit is contained in:
Bryce Hutchings 2002-08-24 07:58:49 +00:00
parent 1264fd8601
commit d5d862edda
3 changed files with 36 additions and 26 deletions

View File

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.162 2002/08/24 07:58:49 niceass
// moved sanitizestring to g_util
//
// Revision 1.161 2002/08/23 14:25:05 slicer
// Added a new Referee System with multiple ref support
//
@ -448,7 +451,7 @@ void DeathmatchScoreboardMessage(gentity_t * ent)
ent->client->sess.savedTeam != cl->sess.savedTeam)
alive = qtrue;
}
//MUDANCA ADICIONEI UM INTEIRO
Com_sprintf(entry, sizeof(entry), " %i %i %i %i %i %i %i %i %i %i %i %i",
level.sortedClients[i],
cl->ps.persistant[PERS_SCORE],
@ -470,7 +473,7 @@ void DeathmatchScoreboardMessage(gentity_t * ent)
strcpy(string + stringlength, entry);
stringlength += j;
}
//MUDANCA !!! REMOVI O ULTIMO INTEIRO
trap_SendServerCommand(ent - g_entities, va("scores %i %i %i %i %i %i%s", i,
level.teamScores[TEAM_RED], level.teamScores[TEAM_BLUE],
level.team1ready, level.team2ready,
@ -592,30 +595,6 @@ char *ConcatArgs(int start)
return line;
}
/*
==================
SanitizeString
Remove case and control characters
==================
*/
void SanitizeString(char *in, char *out)
{
while (*in) {
if (*in == 27) {
in += 2; // skip color code
continue;
}
if (*in < 32) {
in++;
continue;
}
*out++ = tolower(*in++);
}
*out = 0;
}
/*
==================
ClientNumberFromString

View File

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.118 2002/08/24 07:58:37 niceass
// moved sanitizestring to g_util
//
// Revision 1.117 2002/08/23 14:25:05 slicer
// Added a new Referee System with multiple ref support
//
@ -938,6 +941,7 @@ gentity_t *G_Find(gentity_t * from, int fieldofs, const char *match);
int G_PlayerAlive(gentity_t *ent);
void G_DebugSaveData(char *Data);
qboolean G_FileSearch(char *Filename, char *Text);
void SanitizeString(char *in, char *out);
//Makro - added
gentity_t *G_Find2(gentity_t * from, int fieldofs, const char *match, int fieldofs2, const char *match2);

View File

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.19 2002/08/24 07:58:15 niceass
// moved sanitizestring to g_util
//
// Revision 1.18 2002/08/21 03:42:04 niceass
// move of some vector functions outside of just game
//
@ -811,3 +814,27 @@ qboolean G_FileSearch(char *Filename, char *Text) {
return ( strstr(buf, Text) != NULL );
}
/*
==================
SanitizeString
Remove case and control characters
==================
*/
void SanitizeString(char *in, char *out)
{
while (*in) {
if (*in == 27) {
in += 2; // skip color code
continue;
}
if (*in < 32) {
in++;
continue;
}
*out++ = tolower(*in++);
}
*out = 0;
}