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

Method ParseChild

src/SB/Game/zNPCTypeDuplotron.cpp:198–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198void zNPCDuplotron::ParseChild(xBase* child)
199{
200 S32 i;
201
202 switch (child->baseType)
203 {
204 case eBaseTypeMovePoint:
205 this->spawner->AddSpawnPoint((zMovePoint*)child);
206 break;
207 case eBaseTypeNPC:
208 this->spawner->AddSpawnNPC((zNPCCommon*)child);
209 break;
210 case eBaseTypeGroup:
211 {
212 xGroup* grp = (xGroup*)child;
213 S32 cnt = xGroupGetCount(grp);
214 for (i = 0; i < cnt; i++)
215 {
216 xBase* grpitem = xGroupGetItemPtr(grp, i);
217 if (grpitem != NULL)
218 {
219 U8 grpitemType = grpitem->baseType;
220 if (grpitemType == eBaseTypeMovePoint)
221 {
222 this->spawner->AddSpawnPoint((zMovePoint*)grpitem);
223 }
224 else if (grpitemType == eBaseTypeNPC)
225 {
226 this->spawner->AddSpawnNPC((zNPCCommon*)grpitem);
227 }
228 else if (grpitemType == eBaseTypeGroup)
229 {
230 this->ParseChild(grpitem);
231 }
232 }
233 }
234 break;
235 }
236
237 default:
238 xSceneID2Name(globals.sceneCur, child->id);
239 break;
240 }
241
242 return;
243}
244
245void zNPCDuplotron::Process(xScene* xscn, F32 dt)
246{

Callers 1

ParseLinksMethod · 0.95

Calls 5

xGroupGetCountFunction · 0.85
xGroupGetItemPtrFunction · 0.85
xSceneID2NameFunction · 0.85
AddSpawnPointMethod · 0.80
AddSpawnNPCMethod · 0.80

Tested by

no test coverage detected