MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / SndPlayFromSFX

Method SndPlayFromSFX

src/SB/Game/zNPCTypeCommon.cpp:3039–3061  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3037}
3038
3039S32 zNPCCommon::SndPlayFromSFX(xSFX* sfx, U32* sid_played)
3040{
3041 U32 aidToPlay;
3042 NPCSndProp* sprop;
3043
3044 this->SndKillSounds(2, 0);
3045 sprop = NPCS_SndFindProps(NPC_STYP_XSFXTALK);
3046
3047 U32 xsid = sfx->asset->soundAssetID;
3048
3049 aidToPlay = this->SndStart(xsid, sprop, MIN(sfx->asset->outerRadius, this->cfg_npc->rad_sound));
3050
3051 if (sid_played != NULL)
3052 {
3053 *sid_played = aidToPlay;
3054 }
3055
3056 if (aidToPlay != 0)
3057 {
3058 return TRUE;
3059 }
3060 return FALSE;
3061}
3062
3063S32 zNPCCommon::SndPlayRandom(en_NPC_SOUND sndtype)
3064{

Callers 1

StartSFXMethod · 0.80

Calls 3

SndKillSoundsMethod · 0.95
SndStartMethod · 0.95
NPCS_SndFindPropsFunction · 0.70

Tested by

no test coverage detected