Exemple #1
0
void Weapon_Statistic::net_load(NET_Packet* P)
{
	m_dwRoundsFired += P->r_u32();
	m_dwBulletsFired += P->r_u32();
	m_dwHitsScored += P->r_u32();
	m_dwKillsScored += P->r_u32();
	u32 HitsSize = P->r_u32();
	for (u32 i = 0; i<HitsSize; i++)
	{
		HitData NewHit;
		NewHit.net_load(P);
		m_Hits.push_back(NewHit);
//		m_dwNumCompleted++;
	}
};
void Weapon_Statistic::net_load(NET_Packet* P, victims_table const & vt, bone_table const & bt)
{
	m_dwRoundsFired += P->r_u32();
	m_dwBulletsFired += P->r_u32();
	m_dwHitsScored += P->r_u32();
	m_dwKillsScored += P->r_u32();
	u32 HitsSize = P->r_u32();
	//P->r_u16(m_explosion_kills); //server sets this parameter ..
	//P->r_u16(m_bleed_kills);	
	for (u32 i = 0; i<HitsSize; i++)
	{
		HitData NewHit;
		NewHit.net_load(P, vt, bt);
		m_Hits.push_back(NewHit);
	}
};
		bool operator()(HitData & hit)
		{
			if (hit.Completed)
			{
				if (NET_PacketSizeLimit - packet_to_write->w_tell() < HitData::net_packet_size)
					return false;
				hit.net_save(packet_to_write, vtable, btable);
				++complete_hits_count;
				return true;
			}
			return false;
		}