| 3061 | } |
| 3062 | |
| 3063 | S32 zNPCCommon::SndPlayRandom(en_NPC_SOUND sndtype) |
| 3064 | { |
| 3065 | U32 xsid; |
| 3066 | NPCConfig* cfg; |
| 3067 | NPCSndProp* sprop; |
| 3068 | U32 aidToPlay; |
| 3069 | |
| 3070 | xsid = 0; |
| 3071 | cfg = this->cfg_npc; |
| 3072 | |
| 3073 | if (NPCS_SndOkToPlay(sndtype)) |
| 3074 | { |
| 3075 | sprop = NPCS_SndFindProps(sndtype); |
| 3076 | aidToPlay = NPCS_SndPickSimilar(sndtype, cfg->snd_trax, cfg->snd_traxShare); |
| 3077 | if (aidToPlay != 0) |
| 3078 | { |
| 3079 | xsid = this->SndStart(aidToPlay, sprop, cfg->rad_sound); |
| 3080 | } |
| 3081 | } |
| 3082 | return (-xsid | xsid) >> 0x1f; |
| 3083 | } |
| 3084 | |
| 3085 | U32 zNPCCommon::SndStart(U32 aid_toplay, NPCSndProp* sprop, F32 radius) |
| 3086 | { |
no test coverage detected