Skip to content

Commit

Permalink
Fix incorrect npc's memory loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
Xottab-DUTY committed Aug 14, 2017
1 parent 3ba633f commit f97093b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/xrGame/hit_memory_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions src/xrGame/sound_memory_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions src/xrGame/visual_memory_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down

0 comments on commit f97093b

Please sign in to comment.