temporary hack solution for map rotation and ctb

This commit is contained in:
Bryce Hutchings 2002-07-16 04:08:28 +00:00
parent 746e82ee21
commit ca6f2863c0
3 changed files with 34 additions and 0 deletions

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.156 2002/07/16 04:08:28 niceass
// temporary hack solution for map rotation and ctb
//
// Revision 1.155 2002/07/11 04:31:07 niceass
// removed team leaders in all gametypes and changed some text from centerprint to console print
//
@ -1921,6 +1924,12 @@ void Cmd_CallVote_f(gentity_t * ent)
return;
}
// NiceAss: Talk to NiceAss before you fix this crappy hack =)
if ( !G_FileSearch( va("scripts/%s.arena", arg2), "rq3ctb" ) && g_gametype.integer == GT_CTF ) {
trap_SendServerCommand(ent - g_entities, va("print \"The map %s does not support CTB.\n\"", arg2));
return;
}
Com_sprintf(level.voteString, sizeof(level.voteString), "%s", arg1);
Com_sprintf(level.voteMap, sizeof(level.voteMap), "%s", arg2);
Com_sprintf(level.voteDisplayString, sizeof(level.voteDisplayString), "%s %s", level.voteString, level.voteMap);

View file

@ -5,6 +5,9 @@
//-----------------------------------------------------------------------------
//
// $Log$
// Revision 1.110 2002/07/16 04:07:53 niceass
// temporary hack solution for map rotation and ctb
//
// Revision 1.109 2002/07/11 04:30:01 niceass
// new func
//
@ -901,6 +904,7 @@ void G_KillBox(gentity_t * ent);
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);
//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.16 2002/07/16 04:06:21 niceass
// temporary hack solution for map rotation and ctb
//
// Revision 1.15 2002/07/11 04:26:46 niceass
// new debug function to save a string to a file
//
@ -831,4 +834,22 @@ void G_DebugSaveData(char *Data) {
trap_FS_Write(Data, strlen(Data), f);
trap_FS_FCloseFile(f);
}
}
qboolean G_FileSearch(char *Filename, char *Text) {
fileHandle_t file;
char *buf;
int len;
len = trap_FS_FOpenFile(Filename, &file, FS_READ);
if (!file)
return qfalse;
buf = G_Alloc(len);
trap_FS_Read(buf, len, file);
trap_FS_FCloseFile(file);
return ( strstr(buf, Text) != NULL );
}