| 78 | |
| 79 | const static float hit_threthhold = 5.f; |
| 80 | void CPHCollisionDamageReceiver::Hit(u16 source_id, u16 bone_id, float power, const Fvector& dir, Fvector& pos) |
| 81 | { |
| 82 | DAMAGE_BONES_I i = FindBone(bone_id); |
| 83 | if (i == m_controled_bones.end()) |
| 84 | return; |
| 85 | power *= i->second; |
| 86 | if (power < hit_threthhold) |
| 87 | return; |
| 88 | |
| 89 | NET_Packet P; |
| 90 | CPhysicsShellHolder* ph = PPhysicsShellHolder(); |
| 91 | SHit HS; |
| 92 | |
| 93 | HS.GenHeader(GE_HIT, ph->ID()); // ph->u_EventGen(P,GE_HIT,ph->ID()); |
| 94 | HS.whoID = ph->ID(); // P.w_u16 (ph->ID()); |
| 95 | HS.weaponID = source_id; // P.w_u16 (source_id); |
| 96 | HS.dir = dir; // P.w_dir (dir); |
| 97 | HS.power = power; // P.w_float (power); |
| 98 | HS.boneID = s16(bone_id); // P.w_s16 (s16(bone_id)); |
| 99 | HS.p_in_bone_space = pos; // P.w_vec3 (pos); |
| 100 | HS.impulse = 0.f; // P.w_float (0.f); |
| 101 | HS.hit_type = (ALife::eHitTypeStrike); // P.w_u16 (ALife::eHitTypeStrike); |
| 102 | HS.Write_Packet(P); |
| 103 | |
| 104 | ph->u_EventSend(P); |
| 105 | } |
| 106 | |
| 107 | void CPHCollisionDamageReceiver::Clear() |
| 108 | { |
no test coverage detected