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

Function zNPCSpawner_GetInstance

src/SB/Game/zNPCSpawner.cpp:49–71  ·  view source on GitHub ↗

Something weird with the conditions here.

Source from the content-addressed store, hash-verified

47
48// Something weird with the conditions here.
49zNPCSpawner* zNPCSpawner_GetInstance()
50{
51 SMDepot* depot = &g_smdepot;
52 zNPCSpawner* sm = (zNPCSpawner*)depot->spawners.list;
53 if (depot->spawners.cnt > 0)
54 {
55 for (S32 i = depot->spawners.cnt; i > 0; i--)
56 {
57 zNPCSpawner* sm_tmp = sm;
58 if (!(sm_tmp->flg_spawner & 1))
59 {
60 sm_tmp->flg_spawner |= 1;
61 return sm_tmp;
62 }
63 sm++;
64 }
65 return NULL;
66 }
67 else
68 {
69 return NULL;
70 }
71}
72
73void zNPCSpawner::Subscribe(zNPCCommon* owner)
74{

Callers 2

make_spawnerMethod · 0.70
SetupMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected