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

Method ThrowOutArtefact

ogsr_engine/xrGame/CustomZone.cpp:1398–1424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1396}
1397
1398void CCustomZone::ThrowOutArtefact(CArtefact* pArtefact)
1399{
1400 Fvector pos;
1401 pos.set(Position());
1402 pos.y += m_fArtefactSpawnHeight;
1403 pArtefact->XFORM().c.set(pos);
1404
1405 if (*m_sArtefactSpawnParticles)
1406 {
1407 CParticlesObject* pParticles;
1408 pParticles = CParticlesObject::Create(*m_sArtefactSpawnParticles, TRUE);
1409 pParticles->UpdateParent(pArtefact->XFORM(), {});
1410 pParticles->Play(false);
1411 }
1412
1413 m_ArtefactBornSound.play_at_pos(0, pos);
1414
1415 NET_Packet PP;
1416 CGameObject::u_EventGen(PP, GE_CHANGE_POS, pArtefact->ID());
1417 PP.w_vec3(pos);
1418 CGameObject::u_EventSend(PP);
1419
1420 Fvector dir;
1421 dir.random_dir();
1422 dir.normalize();
1423 pArtefact->m_pPhysicsShell->applyImpulse(dir, m_fThrowOutPower);
1424}
1425
1426// void CCustomZone::PrefetchArtefacts()
1427//{

Callers

nothing calls this directly

Calls 9

CreateFunction · 0.85
w_vec3Method · 0.80
random_dirMethod · 0.80
setMethod · 0.45
UpdateParentMethod · 0.45
PlayMethod · 0.45
play_at_posMethod · 0.45
normalizeMethod · 0.45
applyImpulseMethod · 0.45

Tested by

no test coverage detected