From a07acb3d14ec42d6630e5ad7055f790f84a0b6a8 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 4 Apr 2021 22:26:27 +0500 Subject: [PATCH] Restore global time on Save/Restore. Same as https://github.com/ValveSoftware/halflife/issues/3065. --- dlls/cbase.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/cbase.cpp b/dlls/cbase.cpp index 4e6292ba..7f1f204a 100644 --- a/dlls/cbase.cpp +++ b/dlls/cbase.cpp @@ -255,6 +255,8 @@ void DispatchSave( edict_t *pent, SAVERESTOREDATA *pSaveData ) { ENTITYTABLE *pTable = &pSaveData->pTable[pSaveData->currentIndex]; + gpGlobals->time = pSaveData->time; + if( pTable->pent != pent ) ALERT( at_error, "ENTITY TABLE OR INDEX IS WRONG!!!!\n" ); @@ -307,6 +309,9 @@ int DispatchRestore( edict_t *pent, SAVERESTOREDATA *pSaveData, int globalEntity Vector oldOffset; CRestore restoreHelper( pSaveData ); + + gpGlobals->time = pSaveData->time; + if( globalEntity ) { CRestore tmpRestore( pSaveData );