From 982b5bc059413a0d31f28890ce11b9eef86922c0 Mon Sep 17 00:00:00 2001 From: asmodai Date: Sun, 17 Jan 2016 15:43:24 +0300 Subject: [PATCH] Fixed mistake in HPAK_AddLump --- rehlds/engine/hashpak.cpp | 6 +++++- rehlds/rehlds/rehlds_api_impl.cpp | 2 +- rehlds/rehlds/rehlds_api_impl.h | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/rehlds/engine/hashpak.cpp b/rehlds/engine/hashpak.cpp index ad9a45b..edcd30c 100644 --- a/rehlds/engine/hashpak.cpp +++ b/rehlds/engine/hashpak.cpp @@ -361,11 +361,15 @@ void HPAK_AddLump(qboolean bUseQueue, char *pakname, struct resource_s *pResourc if (Q_memcmp(pResource->rgucMD5_hash, olddirectory.p_rgEntries[i].resource.rgucMD5_hash, 16) >= 0) { pNewEntry = &newdirectory.p_rgEntries[i]; +#ifndef REHLDS_FIXES while (i < olddirectory.nEntries) { - Q_memcpy(&newdirectory.p_rgEntries[i + 1], &olddirectory.p_rgEntries[i + 1], sizeof(hash_pack_entry_t)); + Q_memcpy(&newdirectory.p_rgEntries[i + 1], &olddirectory.p_rgEntries[i], sizeof(hash_pack_entry_t)); i++; } +#else + Q_memcpy(&newdirectory.p_rgEntries[i + 1], &olddirectory.p_rgEntries[i], (olddirectory.nEntries - i) * sizeof(hash_pack_entry_t)); +#endif break; } } diff --git a/rehlds/rehlds/rehlds_api_impl.cpp b/rehlds/rehlds/rehlds_api_impl.cpp index 5c8fff3..47682b9 100644 --- a/rehlds/rehlds/rehlds_api_impl.cpp +++ b/rehlds/rehlds/rehlds_api_impl.cpp @@ -350,7 +350,7 @@ IRehldsHookRegistry_Steam_GSGetSteamID* CRehldsHookchains::Steam_GSGetSteamID() return &m_Steam_GSGetSteamID; } -CRehldsHookRegistry_SV_TransferConsistencyInfo* CRehldsHookchains::SV_TransferConsistencyInfo() { +IRehldsHookRegistry_SV_TransferConsistencyInfo* CRehldsHookchains::SV_TransferConsistencyInfo() { return &m_SV_TransferConsistencyInfo; } diff --git a/rehlds/rehlds/rehlds_api_impl.h b/rehlds/rehlds/rehlds_api_impl.h index 432afe8..4bd12a1 100644 --- a/rehlds/rehlds/rehlds_api_impl.h +++ b/rehlds/rehlds/rehlds_api_impl.h @@ -231,8 +231,8 @@ public: virtual IRehldsHookRegistry_SV_ActivateServer* SV_ActivateServer(); virtual IRehldsHookRegistry_SV_WriteVoiceCodec* SV_WriteVoiceCodec(); virtual IRehldsHookRegistry_Steam_GSGetSteamID* Steam_GSGetSteamID(); + virtual IRehldsHookRegistry_SV_TransferConsistencyInfo* SV_TransferConsistencyInfo(); virtual IRehldsHookRegistry_Steam_GSBUpdateUserData* Steam_GSBUpdateUserData(); - virtual CRehldsHookRegistry_SV_TransferConsistencyInfo* SV_TransferConsistencyInfo(); }; extern CRehldsHookchains g_RehldsHookchains;