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

Method SndQueUpdate

src/SB/Game/zNPCTypeCommon.cpp:3210–3250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3208}
3209
3210S32 zNPCCommon::SndQueUpdate(F32 dt)
3211{
3212 zNPCCommon* que;
3213 S32 i;
3214 S32 cnt;
3215 NPCSndProp* sprop;
3216
3217 cnt = 0;
3218 que = this;
3219
3220 for (i = 0; i < 4; i++)
3221 {
3222 if (que->snd_queue[0].sndtype != (en_NPC_SOUND)-2)
3223 {
3224 cnt++;
3225 que->snd_queue[0].tmr_delay -= dt;
3226
3227 if (!(que->snd_queue[0].tmr_delay > 0.0f))
3228 {
3229 cnt--;
3230 sprop = NPCS_SndFindProps(que->snd_queue[0].sndtype);
3231 this->SndStart(que->snd_queue[0].sndDirect, sprop, que->snd_queue[0].radius);
3232
3233 que->snd_queue[0].sndtype = NPC_STYP_BOGUS;
3234 que->snd_queue[0].sndDirect = 0;
3235 }
3236 }
3237 que = (zNPCCommon*)((U8*)que + 0x14);
3238 }
3239
3240 if (cnt > 0)
3241 {
3242 this->flg_misc |= 0x2;
3243 }
3244 else
3245 {
3246 this->flg_misc &= ~0x2;
3247 }
3248
3249 return cnt;
3250}
3251
3252S32 zNPCCommon::LassoInit()
3253{

Callers 1

NewTimeMethod · 0.95

Calls 2

SndStartMethod · 0.95
NPCS_SndFindPropsFunction · 0.70

Tested by

no test coverage detected