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

Method NPCMessage

src/SB/Game/zNPCTypeDuplotron.cpp:339–375  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339S32 zNPCDuplotron::NPCMessage(NPCMsg* mail)
340{
341 S32 handled;
342
343 // From the dwarf but I can't find a way to use it that also matches:
344 //xPsyche* psy = this->psy_instinct;
345
346 if (this->psy_instinct != NULL)
347 {
348 zNPCGoalCommon* curgoal = (zNPCGoalCommon*)(psy_instinct->GetCurGoal());
349 if (curgoal != NULL)
350 {
351 handled = curgoal->NPCMessage(mail);
352 }
353
354 if (!handled)
355 {
356 zNPCGoalCommon* recgoal = (zNPCGoalCommon*)(psy_instinct->GetPrevRecovery(0));
357 if (recgoal && recgoal != curgoal)
358 {
359 handled = recgoal->NPCMessage(mail);
360 }
361 }
362 }
363
364 if (!handled)
365 {
366 handled = this->DupoHandleMail(mail);
367 }
368
369 if (!handled)
370 {
371 handled = zNPCCommon::NPCMessage(mail);
372 }
373
374 return handled;
375}
376
377S32 zNPCDuplotron::DupoHandleMail(NPCMsg* mail)
378{

Callers

nothing calls this directly

Calls 4

DupoHandleMailMethod · 0.95
GetCurGoalMethod · 0.80
GetPrevRecoveryMethod · 0.80
NPCMessageFunction · 0.50

Tested by

no test coverage detected