From f97093b31bc069d7f7c6927a2c7feb99bb4ff6ba Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Mon, 14 Aug 2017 14:11:31 +0500 Subject: [PATCH] Fix incorrect npc's memory loading. --- src/xrGame/hit_memory_manager.cpp | 6 +++--- src/xrGame/sound_memory_manager.cpp | 6 +++--- src/xrGame/visual_memory_manager.cpp | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/xrGame/hit_memory_manager.cpp b/src/xrGame/hit_memory_manager.cpp index 65fa0d00e18..857333f45de 100644 --- a/src/xrGame/hit_memory_manager.cpp +++ b/src/xrGame/hit_memory_manager.cpp @@ -331,17 +331,17 @@ void CHitMemoryManager::load(IReader& packet) #ifdef USE_LEVEL_TIME VERIFY(Device.dwTimeGlobal >= object.m_level_time); object.m_level_time = packet.r_u32(); - object.m_level_time += Device.dwTimeGlobal; + object.m_level_time = Device.dwTimeGlobal - object.m_level_time; #endif // USE_LEVEL_TIME #ifdef USE_LAST_LEVEL_TIME VERIFY(Device.dwTimeGlobal >= object.m_last_level_time); object.m_last_level_time = packet.r_u32(); - object.m_last_level_time += Device.dwTimeGlobal; + object.m_last_level_time = Device.dwTimeGlobal - object.m_last_level_time; #endif // USE_LAST_LEVEL_TIME #ifdef USE_FIRST_LEVEL_TIME VERIFY(Device.dwTimeGlobal >= (*I).m_first_level_time); object.m_first_level_time = packet.r_u32(); - object.m_first_level_time += Device.dwTimeGlobal; + object.m_first_level_time = Device.dwTimeGlobal - object.m_first_level_time; #endif // USE_FIRST_LEVEL_TIME packet.r_fvector3(object.m_direction); object.m_bone_index = packet.r_u16(); diff --git a/src/xrGame/sound_memory_manager.cpp b/src/xrGame/sound_memory_manager.cpp index ad3bd81f7a7..8146fd5a328 100644 --- a/src/xrGame/sound_memory_manager.cpp +++ b/src/xrGame/sound_memory_manager.cpp @@ -454,17 +454,17 @@ void CSoundMemoryManager::load(IReader& packet) #ifdef USE_LEVEL_TIME VERIFY(Device.dwTimeGlobal >= object.m_level_time); object.m_level_time = packet.r_u32(); - object.m_level_time += Device.dwTimeGlobal; + object.m_level_time = Device.dwTimeGlobal - object.m_level_time; #endif // USE_LEVEL_TIME #ifdef USE_LAST_LEVEL_TIME VERIFY(Device.dwTimeGlobal >= object.m_last_level_time); object.m_last_level_time = packet.r_u32(); - object.m_last_level_time += Device.dwTimeGlobal; + object.m_last_level_time = Device.dwTimeGlobal - object.m_last_level_time; #endif // USE_LAST_LEVEL_TIME #ifdef USE_FIRST_LEVEL_TIME VERIFY(Device.dwTimeGlobal >= (*I).m_first_level_time); object.m_first_level_time = packet.r_u32(); - object.m_first_level_time += Device.dwTimeGlobal; + object.m_first_level_time = Device.dwTimeGlobal - object.m_first_level_time; #endif // USE_FIRST_LEVEL_TIME object.m_sound_type = (ESoundTypes)packet.r_u32(); object.m_power = packet.r_float(); diff --git a/src/xrGame/visual_memory_manager.cpp b/src/xrGame/visual_memory_manager.cpp index 66bf6d1ab33..67fa10df66d 100644 --- a/src/xrGame/visual_memory_manager.cpp +++ b/src/xrGame/visual_memory_manager.cpp @@ -833,17 +833,17 @@ void CVisualMemoryManager::load(IReader& packet) #ifdef USE_LEVEL_TIME VERIFY(Device.dwTimeGlobal >= object.m_level_time); object.m_level_time = packet.r_u32(); - object.m_level_time += Device.dwTimeGlobal; + object.m_level_time = Device.dwTimeGlobal - object.m_level_time; #endif // USE_LEVEL_TIME #ifdef USE_LAST_LEVEL_TIME VERIFY(Device.dwTimeGlobal >= object.m_last_level_time); object.m_last_level_time = packet.r_u32(); - object.m_last_level_time += Device.dwTimeGlobal; + object.m_last_level_time = Device.dwTimeGlobal - object.m_last_level_time; #endif // USE_LAST_LEVEL_TIME #ifdef USE_FIRST_LEVEL_TIME VERIFY(Device.dwTimeGlobal >= (*I).m_first_level_time); object.m_first_level_time = packet.r_u32(); - object.m_first_level_time += Device.dwTimeGlobal; + object.m_first_level_time = Device.dwTimeGlobal - object.m_first_level_time; #endif // USE_FIRST_LEVEL_TIME object.m_visible.assign(packet.r_u64());