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

Method net_Spawn

ogsr_engine/xrGame/DestroyablePhysicsObject.cpp:41–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41BOOL CDestroyablePhysicsObject::net_Spawn(CSE_Abstract* DC)
42{
43 CSE_Abstract* E = (CSE_Abstract*)DC;
44 const CSE_Visual* visual = smart_cast<const CSE_Visual*>(E);
45 if (visual)
46 {
47 shared_str N = visual_name(E);
48 if (!(N.c_str() && N[0]))
49 {
50 Msg("! [%s]: prevent %s[%u] from spawn because it has no visual", __FUNCTION__, E->name_replace()[0] ? E->name_replace() : E->s_name.c_str(), E->ID);
51 return FALSE;
52 }
53 }
54
55 BOOL res = inherited::net_Spawn(DC);
56 IKinematics* K = smart_cast<IKinematics*>(Visual());
57 CInifile* ini = K->LL_UserData();
58 // R_ASSERT2(ini->section_exist("destroyed"),"destroyable_object must have -destroyed- section in model user data");
59 CPHDestroyable::Init();
60 if (ini && ini->section_exist("destroyed"))
61 CPHDestroyable::Load(ini, "destroyed");
62
63 CDamageManager::reload("damage_section", ini);
64 if (ini)
65 {
66 if (ini->section_exist("immunities"))
67 CHitImmunity::LoadImmunities("immunities", ini);
68 CPHCollisionDamageReceiver::Init();
69 if (ini->section_exist("sound"))
70 m_destroy_sound.create(ini->r_string("sound", "break_sound"), st_Effect, sg_SourceType);
71 if (ini->section_exist("particles"))
72 m_destroy_particles = ini->r_string("particles", "destroy_particles");
73 }
74 CParticlesPlayer::LoadParticles(K);
75 RunStartupAnim(DC);
76 return res;
77}
78
79// void CDestroyablePhysicsObject::Hit (float P,Fvector &dir,CObject *who,s16 element,Fvector p_in_object_space, float impulse, ALife::EHitType hit_type)
80void CDestroyablePhysicsObject::Hit(SHit* pHDS)

Callers

nothing calls this directly

Calls 10

MsgFunction · 0.85
VisualFunction · 0.85
LoadFunction · 0.85
reloadFunction · 0.85
name_replaceMethod · 0.80
LL_UserDataMethod · 0.80
section_existMethod · 0.80
c_strMethod · 0.45
createMethod · 0.45
r_stringMethod · 0.45

Tested by

no test coverage detected