mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 13:47:58 +03:00
Added COM_IsMapValid
This commit is contained in:
parent
09949251ac
commit
c4bcecf5e0
2 changed files with 25 additions and 0 deletions
|
@ -2366,6 +2366,29 @@ void Com_WipeSavegame( const char *savename )
|
|||
FS_DeleteFile( Com_GetArchiveFileName( savename, "tga" ) );
|
||||
}
|
||||
|
||||
qboolean Com_ShiftedStrStr(const char* shifted, const char* name, int offset) {
|
||||
char string[1024];
|
||||
int i;
|
||||
|
||||
for (i = 0; name[i]; i++) {
|
||||
string[i] = name[i] - offset;
|
||||
}
|
||||
string[i] = 0;
|
||||
|
||||
return strstr(string, shifted) != NULL;
|
||||
}
|
||||
|
||||
qboolean COM_IsMapValid(const char* name) {
|
||||
char lowered[MAX_QPATH];
|
||||
|
||||
strcpy(lowered, name);
|
||||
strlwr(lowered);
|
||||
|
||||
return Com_ShiftedStrStr("adSUbn]cS`]V", lowered, 12)
|
||||
|| Com_ShiftedStrStr("RUDUFQJWRTDTGO", lowered, 27)
|
||||
|| Com_ShiftedStrStr("etgfkvu", lowered, -2);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
|
|
@ -1091,6 +1091,8 @@ qboolean Com_SanitizeName( const char *pszOldName, char *pszNewName );
|
|||
const char *Com_GetArchiveFileName( const char *filename, const char *extension );
|
||||
const char *Com_GetArchiveFolder();
|
||||
void Com_WipeSavegame( const char *savename );
|
||||
qboolean Com_ShiftedStrStr(const char* shifted, const char* name, int offset);
|
||||
qboolean COM_IsMapValid(const char* name);
|
||||
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue