Equivalent: regalloc
| 177 | |
| 178 | // Equivalent: regalloc |
| 179 | S32 zNPCGoalPlayerNear::Process(en_trantype* trantype, F32 dt, void* updCtxt, xScene* scene) |
| 180 | { |
| 181 | S32 nextgoal = 0; |
| 182 | zNPCVillager* npc = (zNPCVillager*)(psyche->clt_owner); |
| 183 | NPCConfig* cfg = npc->cfg_npc; |
| 184 | xVec3 dir_plyr = { 0.0f, 0.0f, 0.0f }; |
| 185 | F32 rad_taskshow; |
| 186 | F32 rad_taskhide; |
| 187 | S32 cheats = zGameExtras_CheatFlags(); |
| 188 | |
| 189 | if (flg_plyrnear & 1) |
| 190 | { |
| 191 | flg_plyrnear &= ~1; |
| 192 | nextgoal = NPC_GOAL_TALK; |
| 193 | *trantype = GOAL_TRAN_PUSH; |
| 194 | } |
| 195 | else if (npc->SomethingWonderful() || !npc->PlayerIsStaring()) |
| 196 | { |
| 197 | nextgoal = NPC_GOAL_IDLE; |
| 198 | *trantype = GOAL_TRAN_SET; |
| 199 | } |
| 200 | else if (cheats & 0x400000) |
| 201 | { |
| 202 | ChkCheatDogTrix(&nextgoal, trantype); |
| 203 | } |
| 204 | |
| 205 | if (*trantype != GOAL_TRAN_NONE) |
| 206 | { |
| 207 | return nextgoal; |
| 208 | } |
| 209 | |
| 210 | rad_taskshow = 4.0f; |
| 211 | rad_taskhide = 5.0f; |
| 212 | |
| 213 | if (globals.sceneCur->sceneID == 'HB02') |
| 214 | { |
| 215 | if (npc->SelfType() == NPC_TYPE_GARY) |
| 216 | { |
| 217 | rad_taskshow = 2.75f; |
| 218 | rad_taskhide = 3.25f; |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | xVec3 vex; |
| 223 | F32 y_height = 0.0f; |
| 224 | F32 dist_sq = npc->XZDstSqToPlayer(&vex, &y_height); |
| 225 | |
| 226 | if (talk_font != NULL) |
| 227 | { |
| 228 | if (dist_sq > SQ(rad_taskhide)) |
| 229 | { |
| 230 | talk_font->Off(npc, 0); |
| 231 | } |
| 232 | else if (dist_sq < SQ(rad_taskshow)) |
| 233 | { |
| 234 | talk_font->On(npc, 0); |
| 235 | } |
| 236 | } |
nothing calls this directly
no test coverage detected