| 2998 | } |
| 2999 | |
| 3000 | S32 zNPCCommon::SndPlayFromAFX(zAnimFxSound* afxsnd, U32* sid_played) |
| 3001 | { |
| 3002 | en_NPC_SOUND sndtype; |
| 3003 | F32 radius; |
| 3004 | U32 aidToPlay; |
| 3005 | U32 xsid; |
| 3006 | NPCSndProp* sprop; |
| 3007 | |
| 3008 | sndtype = |
| 3009 | NPCS_SndTypeFromHash(afxsnd->ID, this->cfg_npc->snd_trax, this->cfg_npc->snd_traxShare); |
| 3010 | xsid = NPCS_SndOkToPlay(sndtype); // Already returns S32 |
| 3011 | if ((S32)xsid == 0) // U32 in dwarf but needs to be compared as S32 |
| 3012 | { |
| 3013 | xsid = -1; |
| 3014 | } |
| 3015 | else |
| 3016 | { |
| 3017 | sprop = NPCS_SndFindProps(sndtype); |
| 3018 | |
| 3019 | radius = this->cfg_npc->rad_sound; |
| 3020 | if (sndtype == NPC_STYP_BOGUS) |
| 3021 | { |
| 3022 | aidToPlay = afxsnd->ID; |
| 3023 | } |
| 3024 | else |
| 3025 | { |
| 3026 | aidToPlay = |
| 3027 | NPCS_SndPickSimilar(sndtype, this->cfg_npc->snd_trax, this->cfg_npc->snd_traxShare); |
| 3028 | } |
| 3029 | aidToPlay = this->SndStart(aidToPlay, sprop, radius); |
| 3030 | if (sid_played != 0x0) |
| 3031 | { |
| 3032 | *sid_played = aidToPlay; |
| 3033 | } |
| 3034 | xsid = 1; |
| 3035 | } |
| 3036 | return xsid; |
| 3037 | } |
| 3038 | |
| 3039 | S32 zNPCCommon::SndPlayFromSFX(xSFX* sfx, U32* sid_played) |
| 3040 | { |
no test coverage detected