MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / Hit

Method Hit

ogsr_engine/xrGame/script_game_object2.cpp:149–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147u32 CScriptGameObject::play_cycle(LPCSTR anim) const { return play_cycle(anim, true); }
148
149void 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

Callers

nothing calls this directly

Calls 8

GenHeaderMethod · 0.80
VisualMethod · 0.80
LL_BoneIDMethod · 0.80
Write_PacketMethod · 0.80
objectFunction · 0.50
xr_strlenFunction · 0.50
setMethod · 0.45
u_EventSendMethod · 0.45

Tested by

no test coverage detected