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

Method NPCMessage

src/SB/Game/zNPCTypeVillager.cpp:693–726  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

691}
692
693S32 zNPCVillager::NPCMessage(NPCMsg* mail)
694{
695 S32 handled;
696 xPsyche* psy = this->psy_instinct;
697 zNPCGoalCommon* curgoal;
698 zNPCGoalCommon* recgoal;
699
700 if (psy)
701 {
702 curgoal = (zNPCGoalCommon*)psy->GetCurGoal();
703 if (curgoal)
704 {
705 handled = curgoal->NPCMessage(mail);
706 if (handled)
707 return handled;
708 }
709
710 recgoal = (zNPCGoalCommon*)psy->GetPrevRecovery(0);
711 if (recgoal && recgoal != curgoal)
712 {
713 handled = recgoal->NPCMessage(mail);
714 if (handled)
715 return handled;
716 }
717 }
718
719 handled = this->FolkHandleMail(mail);
720 if (!handled)
721 {
722 handled = zNPCCommon::NPCMessage(mail);
723 }
724
725 return handled;
726}
727
728// non-matching: register shenanigans
729S32 zNPCVillager::FolkHandleMail(NPCMsg* mail)

Callers

nothing calls this directly

Calls 4

FolkHandleMailMethod · 0.95
GetCurGoalMethod · 0.80
GetPrevRecoveryMethod · 0.80
NPCMessageFunction · 0.50

Tested by

no test coverage detected