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

Function zSceneInitFunc_SBNPC

src/SB/Game/zScene.cpp:488–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486}
487
488static U32 zSceneInitFunc_SBNPC(zScene* s, zSceneObjectInstanceDesc* desc, U32 base_idx)
489{
490 S32 count;
491
492 count = s->baseCount[desc->baseType];
493
494 if (count == 0)
495 {
496 return base_idx;
497 }
498
499 s->baseList[desc->baseType] = NULL;
500
501 for (S32 i = 0; i < count; i++)
502 {
503 xEnt* ent;
504 xEntAsset* assdat;
505
506 assdat = (xEntAsset*)xSTFindAssetByType('VIL ', i, NULL);
507 ent = zNPCMgr_createNPCInst(i, assdat);
508
509 zSceneSet(ent, base_idx);
510 xSceneAddEnt(s, s->ents[base_idx]);
511 zSceneObjHashtableAdd(ent->id, ent);
512
513 base_idx++;
514 }
515
516 return base_idx;
517}
518
519static U32 zSceneInitFunc_Player(zScene* s, zSceneObjectInstanceDesc* desc, U32 base_idx)
520{

Callers

nothing calls this directly

Calls 5

zNPCMgr_createNPCInstFunction · 0.85
zSceneSetFunction · 0.85
xSceneAddEntFunction · 0.85
zSceneObjHashtableAddFunction · 0.70
xSTFindAssetByTypeFunction · 0.50

Tested by

no test coverage detected