Skip to content

Commit 2e3c7ba

Browse files
committed
I had to edit is_okay_name_end because some files weren't downloading
1 parent fa018d3 commit 2e3c7ba

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

RawInput2/main.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -549,10 +549,18 @@ void __fastcall Hooked_CDownloadManager_QueueInternal(void* thisptr, void* edx,
549549
#if HAXOR_BSP_PERIODS
550550
bool __stdcall is_okay_name_end(const char* extension, int check_if_bsp)
551551
{
552-
if (check_if_bsp)
553-
return 0 == strcmp(strrchr(extension, '.'), ".bsp"); // only good if equals ".bsp"
554-
else
555-
return 0 == strchr(extension, ' '); // only good if no ' '
552+
auto len = strlen(extension);
553+
554+
if (len != 3 && len != 4)
555+
{
556+
if (check_if_bsp)
557+
{
558+
// if we're here then extension is not ".bzp.bz2", ".xbox.vtx", ".dx80.vtx", ".dx90.vtx", or ".sw.vtx".
559+
return 0 == _stricmp(strrchr(extension, '.'), ".bsp"); // only good if ends with ".bsp"
560+
}
561+
}
562+
563+
return NULL == strchr(extension, ' '); // only good if no ' '
556564
}
557565
__declspec(naked) void Hack_IsValidFileForTransfer_For_Periods_In_Bsp_Name()
558566
{

0 commit comments

Comments
 (0)