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

Method NPCTypeForModel

src/SB/Game/zNPCMgr.cpp:658–687  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

656}
657
658en_NPCTYPES zNPCMgr::NPCTypeForModel(U32 brainID, U32 mdl_hash)
659{
660 if (brainID != NULL)
661 {
662 for (int i = 0; i < sizeof(g_brainTable) / sizeof(g_brainTable[0]); i++)
663 {
664 if (brainID == g_brainTable[i].id)
665 {
666 return g_brainTable[i].type;
667 }
668 }
669 }
670
671 en_NPCTYPES usetype = NPC_TYPE_UNKNOWN;
672 for (NPCMTypeTable* rec = g_tbltype; rec->useNPCType != NPC_TYPE_UNKNOWN; rec++)
673 {
674 if (rec->hashOfName == mdl_hash)
675 {
676 usetype = rec->useNPCType;
677 break;
678 }
679 }
680
681 if (usetype == NPC_TYPE_UNKNOWN)
682 {
683 usetype = NPC_TYPE_COMMON;
684 }
685
686 return usetype;
687}
688
689S32 zNPCMgr_OrdTest_npcid(const void* vkey, void* vitem)
690{

Callers 1

CreateNPCMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected