Skip to content

Commit f97093b

Browse files
committed
Fix incorrect npc's memory loading.
1 parent 3ba633f commit f97093b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/xrGame/hit_memory_manager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,17 +331,17 @@ void CHitMemoryManager::load(IReader& packet)
331331
#ifdef USE_LEVEL_TIME
332332
VERIFY(Device.dwTimeGlobal >= object.m_level_time);
333333
object.m_level_time = packet.r_u32();
334-
object.m_level_time += Device.dwTimeGlobal;
334+
object.m_level_time = Device.dwTimeGlobal - object.m_level_time;
335335
#endif // USE_LEVEL_TIME
336336
#ifdef USE_LAST_LEVEL_TIME
337337
VERIFY(Device.dwTimeGlobal >= object.m_last_level_time);
338338
object.m_last_level_time = packet.r_u32();
339-
object.m_last_level_time += Device.dwTimeGlobal;
339+
object.m_last_level_time = Device.dwTimeGlobal - object.m_last_level_time;
340340
#endif // USE_LAST_LEVEL_TIME
341341
#ifdef USE_FIRST_LEVEL_TIME
342342
VERIFY(Device.dwTimeGlobal >= (*I).m_first_level_time);
343343
object.m_first_level_time = packet.r_u32();
344-
object.m_first_level_time += Device.dwTimeGlobal;
344+
object.m_first_level_time = Device.dwTimeGlobal - object.m_first_level_time;
345345
#endif // USE_FIRST_LEVEL_TIME
346346
packet.r_fvector3(object.m_direction);
347347
object.m_bone_index = packet.r_u16();

src/xrGame/sound_memory_manager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,17 +454,17 @@ void CSoundMemoryManager::load(IReader& packet)
454454
#ifdef USE_LEVEL_TIME
455455
VERIFY(Device.dwTimeGlobal >= object.m_level_time);
456456
object.m_level_time = packet.r_u32();
457-
object.m_level_time += Device.dwTimeGlobal;
457+
object.m_level_time = Device.dwTimeGlobal - object.m_level_time;
458458
#endif // USE_LEVEL_TIME
459459
#ifdef USE_LAST_LEVEL_TIME
460460
VERIFY(Device.dwTimeGlobal >= object.m_last_level_time);
461461
object.m_last_level_time = packet.r_u32();
462-
object.m_last_level_time += Device.dwTimeGlobal;
462+
object.m_last_level_time = Device.dwTimeGlobal - object.m_last_level_time;
463463
#endif // USE_LAST_LEVEL_TIME
464464
#ifdef USE_FIRST_LEVEL_TIME
465465
VERIFY(Device.dwTimeGlobal >= (*I).m_first_level_time);
466466
object.m_first_level_time = packet.r_u32();
467-
object.m_first_level_time += Device.dwTimeGlobal;
467+
object.m_first_level_time = Device.dwTimeGlobal - object.m_first_level_time;
468468
#endif // USE_FIRST_LEVEL_TIME
469469
object.m_sound_type = (ESoundTypes)packet.r_u32();
470470
object.m_power = packet.r_float();

src/xrGame/visual_memory_manager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -833,17 +833,17 @@ void CVisualMemoryManager::load(IReader& packet)
833833
#ifdef USE_LEVEL_TIME
834834
VERIFY(Device.dwTimeGlobal >= object.m_level_time);
835835
object.m_level_time = packet.r_u32();
836-
object.m_level_time += Device.dwTimeGlobal;
836+
object.m_level_time = Device.dwTimeGlobal - object.m_level_time;
837837
#endif // USE_LEVEL_TIME
838838
#ifdef USE_LAST_LEVEL_TIME
839839
VERIFY(Device.dwTimeGlobal >= object.m_last_level_time);
840840
object.m_last_level_time = packet.r_u32();
841-
object.m_last_level_time += Device.dwTimeGlobal;
841+
object.m_last_level_time = Device.dwTimeGlobal - object.m_last_level_time;
842842
#endif // USE_LAST_LEVEL_TIME
843843
#ifdef USE_FIRST_LEVEL_TIME
844844
VERIFY(Device.dwTimeGlobal >= (*I).m_first_level_time);
845845
object.m_first_level_time = packet.r_u32();
846-
object.m_first_level_time += Device.dwTimeGlobal;
846+
object.m_first_level_time = Device.dwTimeGlobal - object.m_first_level_time;
847847
#endif // USE_FIRST_LEVEL_TIME
848848
object.m_visible.assign(packet.r_u64());
849849

0 commit comments

Comments
 (0)