diff --git a/src/xrGame/ActorHelmet.cpp b/src/xrGame/ActorHelmet.cpp index 3b6e4a5d435..eb98434c37d 100644 --- a/src/xrGame/ActorHelmet.cpp +++ b/src/xrGame/ActorHelmet.cpp @@ -74,20 +74,6 @@ bool CHelmet::net_Spawn(CSE_Abstract* DC) return (res); } -void CHelmet::net_Export(NET_Packet& P) -{ - inherited::net_Export(P); - P.w_float_q8(GetCondition(), 0.0f, 1.0f); -} - -void CHelmet::net_Import(NET_Packet& P) -{ - inherited::net_Import(P); - float _cond; - P.r_float_q8(_cond, 0.0f, 1.0f); - SetCondition(_cond); -} - void CHelmet::OnH_A_Chield() { inherited::OnH_A_Chield(); diff --git a/src/xrGame/ActorHelmet.h b/src/xrGame/ActorHelmet.h index eeff88ddc3b..4b44677ab67 100644 --- a/src/xrGame/ActorHelmet.h +++ b/src/xrGame/ActorHelmet.h @@ -23,8 +23,6 @@ class CHelmet : public CInventoryItemObject virtual void OnMoveToSlot(const SInvItemPlace& previous_place); virtual void OnMoveToRuck(const SInvItemPlace& previous_place); virtual bool net_Spawn(CSE_Abstract* DC); - virtual void net_Export(NET_Packet& P); - virtual void net_Import(NET_Packet& P); virtual void OnH_A_Chield(); float GetDefHitTypeProtection(ALife::EHitType hit_type); diff --git a/src/xrGame/CustomOutfit.cpp b/src/xrGame/CustomOutfit.cpp index 1d67b5682cd..23fb6af57a1 100644 --- a/src/xrGame/CustomOutfit.cpp +++ b/src/xrGame/CustomOutfit.cpp @@ -35,20 +35,6 @@ bool CCustomOutfit::net_Spawn(CSE_Abstract* DC) return (res); } -void CCustomOutfit::net_Export(NET_Packet& P) -{ - inherited::net_Export(P); - P.w_float_q8(GetCondition(), 0.0f, 1.0f); -} - -void CCustomOutfit::net_Import(NET_Packet& P) -{ - inherited::net_Import(P); - float _cond; - P.r_float_q8(_cond, 0.0f, 1.0f); - SetCondition(_cond); -} - void CCustomOutfit::OnH_A_Chield() { inherited::OnH_A_Chield(); diff --git a/src/xrGame/CustomOutfit.h b/src/xrGame/CustomOutfit.h index f436f1d0397..a0e90317ea0 100644 --- a/src/xrGame/CustomOutfit.h +++ b/src/xrGame/CustomOutfit.h @@ -63,8 +63,6 @@ class CCustomOutfit : public CInventoryItemObject const shared_str& GetFullIconName() const { return m_full_icon_name; } u32 get_artefact_count() const { return m_artefact_count; } virtual bool net_Spawn(CSE_Abstract* DC); - virtual void net_Export(NET_Packet& P); - virtual void net_Import(NET_Packet& P); void ApplySkinModel(CActor* pActor, bool bDress, bool bHUDOnly); void ReloadBonesProtection(); void AddBonesProtection(LPCSTR bones_section); diff --git a/src/xrGame/Weapon.cpp b/src/xrGame/Weapon.cpp index e571052d4d1..9a771a81b1f 100644 --- a/src/xrGame/Weapon.cpp +++ b/src/xrGame/Weapon.cpp @@ -609,8 +609,6 @@ void CWeapon::net_Export(NET_Packet& P) { inherited::net_Export(P); - P.w_float_q8(GetCondition(), 0.0f, 1.0f); - u8 need_upd = IsUpdating() ? 1 : 0; P.w_u8(need_upd); P.w_u16(u16(iAmmoElapsed)); @@ -624,10 +622,6 @@ void CWeapon::net_Import(NET_Packet& P) { inherited::net_Import(P); - float _cond; - P.r_float_q8(_cond, 0.0f, 1.0f); - SetCondition(_cond); - u8 flags = 0; P.r_u8(flags); diff --git a/src/xrGame/inventory_item.cpp b/src/xrGame/inventory_item.cpp index 2230f8b620e..30919f5e74c 100644 --- a/src/xrGame/inventory_item.cpp +++ b/src/xrGame/inventory_item.cpp @@ -334,9 +334,6 @@ bool CInventoryItem::net_Spawn(CSE_Abstract* DC) if (!pSE_InventoryItem) return TRUE; - //!!! - m_fCondition = pSE_InventoryItem->m_fCondition; - if (GameID() != eGameIDSingle) object().processing_activate(); @@ -400,6 +397,10 @@ void CInventoryItem::net_Import(NET_Packet& P) //////////////////////////////////////////// P.r_u8(); // active (not freezed ot not) + float _cond; + P.r_float_q8(_cond, 0.0f, 1.0f); + SetCondition(_cond); + if (this->cast_game_object()->Local()) { return; @@ -663,6 +664,8 @@ void CInventoryItem::net_Export(NET_Packet& P) P.w_u8(0); // freezed } + P.w_float_q8(GetCondition(), 0.0f, 1.0f); + /*if (object().H_Parent() || IsGameTypeSingle()) { P.w_u8 (0); diff --git a/src/xrServerEntities/xrServer_Objects_ALife_Items.cpp b/src/xrServerEntities/xrServer_Objects_ALife_Items.cpp index 6a2003df9a2..20ddd748e30 100644 --- a/src/xrServerEntities/xrServer_Objects_ALife_Items.cpp +++ b/src/xrServerEntities/xrServer_Objects_ALife_Items.cpp @@ -181,6 +181,7 @@ void CSE_ALifeInventoryItem::UPDATE_Write(NET_Packet& tNetPacket) } } tNetPacket.w_u8(1); // not freezed - doesn't mean anything... + tNetPacket.w_float_q8(m_fCondition, 0.0f, 1.0f); }; void CSE_ALifeInventoryItem::UPDATE_Read(NET_Packet& tNetPacket) @@ -302,6 +303,8 @@ void CSE_ALifeInventoryItem::UPDATE_Read(NET_Packet& tNetPacket) #endif freezed = true; } + + tNetPacket.r_float_q8(m_fCondition, 0.0f, 1.0f); }; #ifndef MASTER_GOLD @@ -526,7 +529,6 @@ void CSE_ALifeItemWeapon::UPDATE_Read(NET_Packet& tNetPacket) { inherited::UPDATE_Read(tNetPacket); - tNetPacket.r_float_q8(m_fCondition, 0.0f, 1.0f); tNetPacket.r_u8(wpn_flags); tNetPacket.r_u16(a_elapsed); tNetPacket.r_u8(m_addon_flags.flags); @@ -540,7 +542,6 @@ void CSE_ALifeItemWeapon::UPDATE_Write(NET_Packet& tNetPacket) { inherited::UPDATE_Write(tNetPacket); - tNetPacket.w_float_q8(m_fCondition, 0.0f, 1.0f); tNetPacket.w_u8(wpn_flags); tNetPacket.w_u16(a_elapsed); tNetPacket.w_u8(m_addon_flags.get()); @@ -1012,13 +1013,11 @@ void CSE_ALifeItemCustomOutfit::STATE_Write(NET_Packet& tNetPacket) { inherited: void CSE_ALifeItemCustomOutfit::UPDATE_Read(NET_Packet& tNetPacket) { inherited::UPDATE_Read(tNetPacket); - tNetPacket.r_float_q8(m_fCondition, 0.0f, 1.0f); } void CSE_ALifeItemCustomOutfit::UPDATE_Write(NET_Packet& tNetPacket) { inherited::UPDATE_Write(tNetPacket); - tNetPacket.w_float_q8(m_fCondition, 0.0f, 1.0f); } #ifndef MASTER_GOLD @@ -1036,13 +1035,11 @@ void CSE_ALifeItemHelmet::STATE_Write(NET_Packet& tNetPacket) { inherited::STATE void CSE_ALifeItemHelmet::UPDATE_Read(NET_Packet& tNetPacket) { inherited::UPDATE_Read(tNetPacket); - tNetPacket.r_float_q8(m_fCondition, 0.0f, 1.0f); } void CSE_ALifeItemHelmet::UPDATE_Write(NET_Packet& tNetPacket) { inherited::UPDATE_Write(tNetPacket); - tNetPacket.w_float_q8(m_fCondition, 0.0f, 1.0f); } #ifndef MASTER_GOLD