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

Method Enter

src/SB/Game/zNPCGoalVillager.cpp:64–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64S32 zNPCGoalPlayerNear::Enter(F32 dt, void* updCtxt)
65{
66 zNPCVillager* npc = (zNPCVillager*)(psyche->clt_owner);
67 flg_plyrnear = 0;
68 npc->FindMyConverse();
69 if (npc->converse != NULL)
70 {
71 flg_plyrnear |= 2;
72 talk_glyph = GLYF_Acquire(NPC_GLYPH_TALK);
73 if (talk_glyph != NULL)
74 {
75 talk_glyph->Enable(1);
76 xVec3 ang_delta = { 0.052359881f, 0.0f, 0.0f }; // DEG2RAD(3)
77 talk_glyph->RotSet(&ang_delta, 0);
78 }
79 talk_font = NPCWidget_Find(NPC_WIDGE_TALK);
80 }
81 else if ((npc->npcass->taskWidgetPrime != 0) || (npc->npcass->taskWidgetSecond != 0))
82 {
83 talk_glyph = GLYF_Acquire(NPC_GLYPH_TALKOTHER);
84
85 if (talk_glyph != NULL)
86 {
87 talk_glyph->Enable(1);
88 xVec3 ang_delta = { -0.052359881f, 0.0f, 0.0f }; // DEG2RAD(-3)
89 talk_glyph->RotSet(&ang_delta, 0);
90 }
91 flg_plyrnear |= 4;
92 }
93
94 npc->pflags &= 0xfb;
95 npc->VelStop();
96 tmr_actBored = ((xurand() - 0.5f) * 0.25f) * 4.0f + 4.0f;
97
98 S32 cheats = zGameExtras_CheatFlags();
99 if (cheats & 0x20000)
100 {
101 ChkCheatMedic();
102 }
103
104 return zNPCGoalCommon::Enter(dt, updCtxt);
105}
106
107S32 zNPCGoalPlayerNear::Exit(F32 dt, void* updCtxt)
108{

Callers

nothing calls this directly

Calls 15

NPCWidget_FindFunction · 0.85
xurandFunction · 0.85
zGameExtras_CheatFlagsFunction · 0.85
xVec3CopyFunction · 0.85
xEntGetPosFunction · 0.85
FindMyConverseMethod · 0.80
EnableMethod · 0.80
RotSetMethod · 0.80
VelStopMethod · 0.80
set_callbackMethod · 0.80
WonderOfTalkingMethod · 0.80
SndPlayRandomMethod · 0.80

Tested by

no test coverage detected