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

Method CheckPlayer

src/SB/Game/zNPCGoalDuplotron.cpp:91–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void zNPCGoalDuploLive::CheckPlayer()
92{
93 zNPCDuplotron* npc = (zNPCDuplotron*)psyche->clt_owner;
94
95 tmr_chkPlyrDist = 0.25f * (xurand() - 0.5f) + 1.0f;
96
97 U32 curid = npc->AnimCurStateID();
98
99 if (curid == g_hash_dupoanim[2])
100 {
101 return;
102 }
103
104 xVec3 v;
105 xVec3Sub(&v, xEntGetPos(&globals.player.ent), xEntGetPos(npc));
106
107 F32 len = xVec3Length2(&v);
108
109 if (len > SQ(npc->cfg_npc->rad_detect))
110 {
111 DoAutoAnim(NPC_GSPOT_RESUME, 0);
112 }
113 else
114 {
115 DoAutoAnim(NPC_GSPOT_STARTALT, 0);
116 }
117}
118
119S32 zNPCGoalDuploLive::NPCMessage(NPCMsg* mail)
120{

Callers

nothing calls this directly

Calls 6

xurandFunction · 0.85
xVec3SubFunction · 0.85
xEntGetPosFunction · 0.85
xVec3Length2Function · 0.85
DoAutoAnimFunction · 0.85
AnimCurStateIDMethod · 0.80

Tested by

no test coverage detected