| 44 | } |
| 45 | |
| 46 | void CExplosiveRocket::Contact(const Fvector& pos, const Fvector& normal) |
| 47 | { |
| 48 | if (eCollide == m_eState) |
| 49 | return; |
| 50 | |
| 51 | bool safe_to_explode = true; |
| 52 | if (m_bLaunched) |
| 53 | { |
| 54 | if (m_pOwner) |
| 55 | { |
| 56 | float dist = m_pOwner->Position().distance_to(pos); |
| 57 | if (dist < m_safe_dist_to_explode) |
| 58 | { |
| 59 | safe_to_explode = false; |
| 60 | CActor* pActor = smart_cast<CActor*>(m_pOwner); |
| 61 | if (pActor) |
| 62 | { |
| 63 | u32 lvid = UsedAI_Locations() ? ai_location().level_vertex_id() : ai().level_graph().nearest_vertex_id(pos); |
| 64 | CSE_Abstract* object = Level().spawn_item(real_grenade_name.c_str(), pos, lvid, 0xffff, true); |
| 65 | |
| 66 | CSE_ALifeItemAmmo* ammo = smart_cast<CSE_ALifeItemAmmo*>(object); |
| 67 | ammo->m_boxSize = 1; |
| 68 | |
| 69 | NET_Packet P; |
| 70 | object->Spawn_Write(P, TRUE); |
| 71 | Level().Send(P, net_flags(TRUE)); |
| 72 | F_entity_Destroy(object); |
| 73 | } |
| 74 | DestroyObject(); |
| 75 | } |
| 76 | } |
| 77 | if (safe_to_explode) |
| 78 | CExplosive::GenExplodeEvent(pos, normal); |
| 79 | } |
| 80 | |
| 81 | inherited::Contact(pos, normal); |
| 82 | } |
| 83 | |
| 84 | void CExplosiveRocket::net_Destroy() |
| 85 | { |
nothing calls this directly
no test coverage detected