@@ -705,13 +705,18 @@ void CVisualMemoryManager::update(float time_delta)
705705 }
706706#endif
707707
708- if (m_object && g_actor && m_object-> is_relation_enemy ( Actor ()) )
708+ if (m_object && g_actor)
709709 {
710- xr_vector<CNotYetVisibleObject>::iterator I = std::find_if (
711- m_not_yet_visible_objects.begin (), m_not_yet_visible_objects.end (), CNotYetVisibleObjectPredicate (Actor ()));
712- if (I != m_not_yet_visible_objects.end ())
710+ if (m_object->is_relation_enemy (Actor ()))
713711 {
714- SetActorVisibility (m_object->ID (), clampr ((*I).m_value / visibility_threshold (), 0 .f , 1 .f ));
712+ xr_vector<CNotYetVisibleObject>::iterator I = std::find_if (m_not_yet_visible_objects.begin (),
713+ m_not_yet_visible_objects.end (), CNotYetVisibleObjectPredicate (Actor ()));
714+ if (I != m_not_yet_visible_objects.end ())
715+ {
716+ SetActorVisibility (m_object->ID (), clampr ((*I).m_value / visibility_threshold (), 0 .f , 1 .f ));
717+ }
718+ else
719+ SetActorVisibility (m_object->ID (), 0 .f );
715720 }
716721 else
717722 SetActorVisibility (m_object->ID (), 0 .f );
@@ -771,7 +776,7 @@ void CVisualMemoryManager::save(NET_Packet& packet) const
771776 packet.w_float ((*I).m_object_params .m_orientation .pitch );
772777 packet.w_float ((*I).m_object_params .m_orientation .roll );
773778#endif // USE_ORIENTATION
774- // self params
779+ // self params
775780 packet.w_u32 ((*I).m_self_params .m_level_vertex_id );
776781 packet.w_vec3 ((*I).m_self_params .m_position );
777782#ifdef USE_ORIENTATION
0 commit comments