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

Method PlayHitParticles

ogsr_engine/xrGame/CustomZone.cpp:874–903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

872}
873
874void CCustomZone::PlayHitParticles(CGameObject* pObject)
875{
876 m_hit_sound.play_at_pos(0, pObject->Position());
877
878 shared_str particle_str = NULL;
879
880 if (pObject->Radius() < SMALL_OBJECT_RADIUS)
881 {
882 if (!m_sHitParticlesSmall)
883 return;
884 particle_str = m_sHitParticlesSmall;
885 }
886 else
887 {
888 if (!m_sHitParticlesBig)
889 return;
890 particle_str = m_sHitParticlesBig;
891 }
892
893 if (particle_str.size())
894 {
895 CParticlesPlayer* PP = smart_cast<CParticlesPlayer*>(pObject);
896 if (PP)
897 {
898 u16 play_bone = PP->GetRandomBone();
899 if (play_bone != BI_NONE)
900 PP->StartParticles(particle_str, play_bone, Fvector().set(0, 1, 0), ID());
901 }
902 }
903}
904
905void CCustomZone::PlayEntranceParticles(CGameObject* pObject)
906{

Callers

nothing calls this directly

Calls 8

IDFunction · 0.85
PositionMethod · 0.80
GetRandomBoneMethod · 0.80
play_at_posMethod · 0.45
RadiusMethod · 0.45
sizeMethod · 0.45
StartParticlesMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected