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

Method UpdateContinuous

src/SB/Game/zNPCSpawner.cpp:299–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297}
298
299void zNPCSpawner::UpdateContinuous(F32 dt)
300{
301 SMSPStatus* spstat = NULL;
302
303 switch (wavestat)
304 {
305 case SM_STAT_BEGIN:
306 FillPending();
307
308 if (pendlist.cnt > 0)
309 {
310 wavestat = SM_STAT_INPROG;
311 zEntEvent(npc_owner, eEventDuploWaveBegin);
312
313 flg_spawner &= ~0x20;
314 }
315
316 tmr_wave = tym_delay;
317
318 break;
319 case SM_STAT_INPROG:
320 if (pendlist.cnt < 1)
321 {
322 wavestat = SM_STAT_MARKTIME;
323 }
324 else if (max_spawn > 0 && !(cnt_spawn < max_spawn))
325 {
326 wavestat = SM_STAT_ABORT;
327 }
328 else if (tmr_wave < 0.0f)
329 {
330 SMNPCStatus* npcstat = NextPendingNPC(0);
331 if (npcstat != NULL)
332 {
333 spstat = SelectSP(npcstat);
334 }
335
336 if (!(spstat == NULL))
337 {
338 SpawnBeastie(npcstat, spstat);
339 }
340
341 tmr_wave = tym_delay * (0.25f * (xurand() - 0.5f)) + tym_delay;
342 }
343
344 break;
345 // MarkTime case is the significantly different one between this function and UpdateDiscreet
346 case SM_STAT_MARKTIME:
347 if (flg_spawner & 0x2)
348 {
349 wavestat = SM_STAT_ABORT;
350 }
351 else if (max_spawn > 0 && !(cnt_spawn < max_spawn))
352 {
353 wavestat = SM_STAT_ABORT;
354 }
355 else
356 {

Callers

nothing calls this directly

Calls 4

SelectSPFunction · 0.85
SpawnBeastieFunction · 0.85
xurandFunction · 0.85
zEntEventFunction · 0.50

Tested by

no test coverage detected