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$ // $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 // Revision 1.161 2002/08/23 14:25:05 slicer
// Added a new Referee System with multiple ref support // 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) ent->client->sess.savedTeam != cl->sess.savedTeam)
alive = qtrue; alive = qtrue;
} }
//MUDANCA ADICIONEI UM INTEIRO
Com_sprintf(entry, sizeof(entry), " %i %i %i %i %i %i %i %i %i %i %i %i", Com_sprintf(entry, sizeof(entry), " %i %i %i %i %i %i %i %i %i %i %i %i",
level.sortedClients[i], level.sortedClients[i],
cl->ps.persistant[PERS_SCORE], cl->ps.persistant[PERS_SCORE],
@ -470,7 +473,7 @@ void DeathmatchScoreboardMessage(gentity_t * ent)
strcpy(string + stringlength, entry); strcpy(string + stringlength, entry);
stringlength += j; stringlength += j;
} }
//MUDANCA !!! REMOVI O ULTIMO INTEIRO
trap_SendServerCommand(ent - g_entities, va("scores %i %i %i %i %i %i%s", i, trap_SendServerCommand(ent - g_entities, va("scores %i %i %i %i %i %i%s", i,
level.teamScores[TEAM_RED], level.teamScores[TEAM_BLUE], level.teamScores[TEAM_RED], level.teamScores[TEAM_BLUE],
level.team1ready, level.team2ready, level.team1ready, level.team2ready,
@ -592,30 +595,6 @@ char *ConcatArgs(int start)
return line; 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 ClientNumberFromString

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $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 // Revision 1.117 2002/08/23 14:25:05 slicer
// Added a new Referee System with multiple ref support // 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); int G_PlayerAlive(gentity_t *ent);
void G_DebugSaveData(char *Data); void G_DebugSaveData(char *Data);
qboolean G_FileSearch(char *Filename, char *Text); qboolean G_FileSearch(char *Filename, char *Text);
void SanitizeString(char *in, char *out);
//Makro - added //Makro - added
gentity_t *G_Find2(gentity_t * from, int fieldofs, const char *match, int fieldofs2, const char *match2); gentity_t *G_Find2(gentity_t * from, int fieldofs, const char *match, int fieldofs2, const char *match2);

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $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 // Revision 1.18 2002/08/21 03:42:04 niceass
// move of some vector functions outside of just game // 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 ); 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;
}