| 147 | u32 CScriptGameObject::play_cycle(LPCSTR anim) const { return play_cycle(anim, true); } |
| 148 | |
| 149 | void CScriptGameObject::Hit(CScriptHit* tpLuaHit) |
| 150 | { |
| 151 | CScriptHit& tLuaHit = *tpLuaHit; |
| 152 | NET_Packet P; |
| 153 | SHit HS; |
| 154 | HS.GenHeader(GE_HIT, object().ID()); // object().u_EventGen(P,GE_HIT,object().ID()); |
| 155 | THROW2(tLuaHit.m_tpDraftsman, "Where is hit initiator??!"); // THROW2 (tLuaHit.m_tpDraftsman,"Where is hit initiator??!"); |
| 156 | HS.whoID = u16(tLuaHit.m_tpDraftsman->ID()); // P.w_u16 (u16(tLuaHit.m_tpDraftsman->ID())); |
| 157 | HS.weaponID = 0; // P.w_u16 (0); |
| 158 | HS.dir = tLuaHit.m_tDirection; // P.w_dir (tLuaHit.m_tDirection); |
| 159 | HS.power = tLuaHit.m_fPower; // P.w_float (tLuaHit.m_fPower); |
| 160 | IKinematics* V = smart_cast<IKinematics*>(object().Visual()); // IKinematics *V = smart_cast<IKinematics*>(object().Visual()); |
| 161 | if (V && xr_strlen(tLuaHit.m_caBoneName)) // if (xr_strlen (tLuaHit.m_caBoneName)) |
| 162 | HS.boneID = (V->LL_BoneID(tLuaHit.m_caBoneName)); // P.w_s16 (V->LL_BoneID(tLuaHit.m_caBoneName)); |
| 163 | else // else |
| 164 | HS.boneID = (s16(0)); // P.w_s16 (s16(0)); |
| 165 | HS.p_in_bone_space = Fvector().set(0, 0, 0); // P.w_vec3 (Fvector().set(0,0,0)); |
| 166 | HS.impulse = tLuaHit.m_fImpulse; // P.w_float (tLuaHit.m_fImpulse); |
| 167 | HS.hit_type = (ALife::EHitType)(tLuaHit.m_tHitType); // P.w_u16 (u16(tLuaHit.m_tHitType)); |
| 168 | HS.Write_Packet(P); |
| 169 | |
| 170 | object().u_EventSend(P); |
| 171 | } |
| 172 | |
| 173 | #pragma todo("Dima to Dima : find out why user defined conversion operators work incorrect") |
| 174 |
nothing calls this directly
no test coverage detected