diff --git a/rehlds/engine/common.cpp b/rehlds/engine/common.cpp index ce8ccc2..aa88359 100644 --- a/rehlds/engine/common.cpp +++ b/rehlds/engine/common.cpp @@ -2167,8 +2167,8 @@ void COM_CopyFileChunk(FileHandle_t dst, FileHandle_t src, int nSize) while (copysize > COM_COPY_CHUNK_SIZE) { - FS_Read(copybuf, 1, COM_COPY_CHUNK_SIZE, src); - FS_Write(copybuf, 1, COM_COPY_CHUNK_SIZE, dst); + FS_Read(copybuf, COM_COPY_CHUNK_SIZE, 1, src); + FS_Write(copybuf, COM_COPY_CHUNK_SIZE, 1, dst); copysize -= COM_COPY_CHUNK_SIZE; } diff --git a/rehlds/engine/filesystem_internal.cpp b/rehlds/engine/filesystem_internal.cpp index b6cf490..3edc358 100644 --- a/rehlds/engine/filesystem_internal.cpp +++ b/rehlds/engine/filesystem_internal.cpp @@ -156,13 +156,21 @@ int FS_EndOfFile(FileHandle_t file) /* <25fa9> ../engine/filesystem_internal.cpp:131 */ int FS_Read(void *pOutput, int size, int count, FileHandle_t file) { +#ifdef REHLDS_FIXES + return g_pFileSystem->Read(pOutput, size * count, file); +#else // REHLDS_FIXES return g_pFileSystem->Read(pOutput, size, file); +#endif // REHLDS_FIXES } /* <2641e> ../engine/filesystem_internal.cpp:138 */ int FS_Write(const void *pInput, int size, int count, FileHandle_t file) { +#ifdef REHLDS_FIXES + return g_pFileSystem->Write(pInput, size * count, file); +#else // REHLDS_FIXES return g_pFileSystem->Write(pInput, size, file); +#endif // REHLDS_FIXES } /* <26479> ../engine/filesystem_internal.cpp:145 */ diff --git a/rehlds/engine/hashpak.cpp b/rehlds/engine/hashpak.cpp index edcd30c..9d75636 100644 --- a/rehlds/engine/hashpak.cpp +++ b/rehlds/engine/hashpak.cpp @@ -850,7 +850,7 @@ void HPAK_CreatePak(char *pakname, struct resource_s *pResource, void *pData, Fi curpos = FS_Tell(fp); FS_Write(&hash_pack_dir.nEntries, 4, 1, fp); - FS_Write(&hash_pack_dir.p_rgEntries, sizeof(hash_pack_entry_t), 1, fp); + FS_Write(hash_pack_dir.p_rgEntries, sizeof(hash_pack_entry_t), 1, fp); if (hash_pack_dir.p_rgEntries) { diff --git a/rehlds/engine/sys_dll2.cpp b/rehlds/engine/sys_dll2.cpp index c9baeeb..7d75405 100644 --- a/rehlds/engine/sys_dll2.cpp +++ b/rehlds/engine/sys_dll2.cpp @@ -651,7 +651,7 @@ NOXREF int BuildMapCycleListHints(char **hints) if (length) { pFileList = (char *)malloc(length); - if (pFileList && FS_Read(pFileList, length, 0, pFile) != 1) + if (pFileList && FS_Read(pFileList, length, 1, pFile) != 1) { while (1) {