| 1341 | } |
| 1342 | |
| 1343 | void zNPCGoalAlertChomper::CirclePlayer(F32 dt) |
| 1344 | { |
| 1345 | zNPCRobot* npc = (zNPCRobot*)this->psyche->clt_owner; |
| 1346 | xVec3 pos_plyr; |
| 1347 | xVec3 dir_plyr; |
| 1348 | |
| 1349 | zEntPlayer_PredictPos(&pos_plyr, 1.3f, 1.0f, 0); |
| 1350 | |
| 1351 | if (npc->XZDstSqToPlayer(0, 0) < npc->XZDstSqToPos(&pos_plyr, 0, 0)) |
| 1352 | { |
| 1353 | xVec3Copy(&pos_plyr, xEntGetPos(&globals.player.ent)); |
| 1354 | } |
| 1355 | |
| 1356 | F32 rot; |
| 1357 | npc->XZVecToPlayer(&dir_plyr, NULL); |
| 1358 | |
| 1359 | F32 length = xVec3Length(&dir_plyr); |
| 1360 | if (length < 1.0f) |
| 1361 | { |
| 1362 | xVec3Copy(&dir_plyr, NPCC_rightDir(&globals.player.ent)); |
| 1363 | } |
| 1364 | else |
| 1365 | { |
| 1366 | xVec3SMulBy(&dir_plyr, 1.0f / length); |
| 1367 | } |
| 1368 | |
| 1369 | xVec3 dir_dest = dir_plyr; |
| 1370 | xVec3 dir; |
| 1371 | |
| 1372 | npc->ThrottleAdjust(dt, 5.0f, 10.0f); |
| 1373 | NPCC_ang_toXZDir(npc->frame->rot.angle + (npc->TurnToFace(dt, &dir_dest, DEG2RAD(270))), &dir); |
| 1374 | npc->ThrottleApply(dt, &dir, 0); |
| 1375 | } |
| 1376 | |
| 1377 | void zNPCGoalAlertChomper::GetInArena(F32 dt) |
| 1378 | { |
nothing calls this directly
no test coverage detected