From f58544a1568f6abbbe28bf3c5c94b5b967e4f69c Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Mon, 19 Feb 2024 02:07:20 +0500 Subject: [PATCH] Fix save game system not saving arrays of EHANDLEs if the first half of the array contains null handles. Same as https://github.com/twhl-community/halflife-updated/commit/d5d96d38830be1f9d41427c89d5a600fc778ff30. --- dlls/util.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/util.cpp b/dlls/util.cpp index 6cfebc10..56819f44 100644 --- a/dlls/util.cpp +++ b/dlls/util.cpp @@ -2223,7 +2223,7 @@ int CRestore::ReadField( void *pBaseData, TYPEDESCRIPTION *pFields, int fieldCou break; case FIELD_EHANDLE: // Input and Output sizes are different! - pOutputData = (char *)pOutputData + j * ( sizeof(EHANDLE) - gSizes[pTest->fieldType] ); + pInputData = (char*)pData + j * gSizes[pTest->fieldType]; entityIndex = *(int *)pInputData; pent = EntityFromIndex( entityIndex ); if( pent )