MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / GetTalkTarget

Function GetTalkTarget

engine/Poseidon/AI/AIArcade.cpp:1072–1099  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1070// Talk waypoint
1071
1072static bool GetTalkTarget(AIGroupContext* context, Vector3& pos)
1073{
1074 STATE_PREFIX
1075
1076 int& id = context->_fsm->Var(3);
1077
1078 if (id >= 0 && id < vehiclesMap.Size())
1079 {
1080 EntityAI* veh = vehiclesMap[id];
1081 if (!veh)
1082 {
1083 return false;
1084 }
1085 const Target* target = group->FindTarget(veh);
1086 if (target)
1087 {
1088 pos = target->position;
1089 return true;
1090 }
1091 const AITargetInfo* info = group->GetCenter()->FindTargetInfo(veh);
1092 if (info)
1093 {
1094 pos = info->_realPos;
1095 return true;
1096 }
1097 }
1098 return false;
1099}
1100
1101static void ArcadeTalkMove(AIGroupContext* context)
1102{

Callers 2

ArcadeTalkMoveFunction · 0.85
CheckArcadeTalkMoveFunction · 0.85

Calls 5

VarMethod · 0.80
FindTargetInfoMethod · 0.80
SizeMethod · 0.45
FindTargetMethod · 0.45
GetCenterMethod · 0.45

Tested by

no test coverage detected