| 1768 | void CCar::OnBeforeExplosion() { setEnabled(FALSE); } |
| 1769 | |
| 1770 | void CCar::CarExplode() |
| 1771 | { |
| 1772 | if (b_exploded) |
| 1773 | return; |
| 1774 | CPHSkeleton::SetNotNeedSave(); |
| 1775 | if (m_car_weapon) |
| 1776 | m_car_weapon->Action(CCarWeapon::eWpnActivate, 0); |
| 1777 | m_lights.TurnOffHeadLights(); |
| 1778 | b_exploded = true; |
| 1779 | CExplosive::GenExplodeEvent(Position(), Fvector().set(0.f, 1.f, 0.f)); |
| 1780 | |
| 1781 | CActor* A = OwnerActor(); |
| 1782 | if (A) |
| 1783 | { |
| 1784 | if (!m_doors.empty()) |
| 1785 | m_doors.begin()->second.GetExitPosition(m_exit_position); |
| 1786 | else |
| 1787 | m_exit_position.set(Position()); |
| 1788 | A->detach_Vehicle(); |
| 1789 | if (A->g_Alive() <= 0.f) |
| 1790 | A->character_physics_support()->movement()->DestroyCharacter(); |
| 1791 | } |
| 1792 | |
| 1793 | callback(GameObject::eDeath)(lua_game_object(), 0); |
| 1794 | |
| 1795 | if (CPHDestroyable::CanDestroy()) |
| 1796 | CPHDestroyable::Destroy(ID(), "physic_destroyable_object"); |
| 1797 | } |
| 1798 | // void CCar::object_contactCallbackFun(bool& do_colide,dContact& c,SGameMtl * /*material_1*/,SGameMtl * /*material_2*/) |
| 1799 | //{ |
| 1800 | // |
nothing calls this directly
no test coverage detected