| 39 | } |
| 40 | |
| 41 | BOOL 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) |
| 80 | void CDestroyablePhysicsObject::Hit(SHit* pHDS) |
nothing calls this directly
no test coverage detected