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

Method CarExplode

ogsr_engine/xrGame/Car.cpp:1770–1797  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1768void CCar::OnBeforeExplosion() { setEnabled(FALSE); }
1769
1770void 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//

Callers

nothing calls this directly

Calls 15

OwnerActorFunction · 0.85
callbackClass · 0.85
DestroyFunction · 0.85
IDFunction · 0.85
TurnOffHeadLightsMethod · 0.80
GetExitPositionMethod · 0.80
detach_VehicleMethod · 0.80
g_AliveMethod · 0.80
DestroyCharacterMethod · 0.80
movementMethod · 0.80
ActionMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected