| 1124 | } |
| 1125 | |
| 1126 | static void CheckArcadeTalkMove(AIGroupContext* context) |
| 1127 | { |
| 1128 | STATE_PREFIX |
| 1129 | if (group->IsPlayerGroup()) |
| 1130 | { |
| 1131 | context->_fsm->SetState(SArcadeTalkWalk, context); |
| 1132 | return; |
| 1133 | } |
| 1134 | |
| 1135 | Vector3 posN; |
| 1136 | if (!GetTalkTarget(context, posN)) |
| 1137 | { |
| 1138 | context->_fsm->SetState(SArcadeSync, context); |
| 1139 | return; |
| 1140 | } |
| 1141 | |
| 1142 | if (!group->Leader()) |
| 1143 | { |
| 1144 | return; |
| 1145 | } |
| 1146 | Vector3Val posL = group->Leader()->Position(); |
| 1147 | Vector3Val posD = mission->_destination; |
| 1148 | |
| 1149 | float dist2LN = posL.Distance2(posN); |
| 1150 | if (dist2LN <= Square(25)) |
| 1151 | { |
| 1152 | context->_fsm->SetState(SArcadeTalkGetOut, context); |
| 1153 | return; |
| 1154 | } |
| 1155 | float dist2DN = posD.Distance2(posN); |
| 1156 | if (dist2DN > 0.01 * dist2LN || group->GetAllDone()) |
| 1157 | { |
| 1158 | mission->_destination = posN; |
| 1159 | |
| 1160 | Command cmd; |
| 1161 | cmd._message = Command::Move; |
| 1162 | cmd._destination = posN; |
| 1163 | cmd._discretion = Command::Undefined; |
| 1164 | cmd._context = Command::CtxMission; |
| 1165 | group->SendCommand(cmd); |
| 1166 | return; |
| 1167 | } |
| 1168 | } |
| 1169 | |
| 1170 | static void ArcadeTalkGetOut(AIGroupContext* context) |
| 1171 | { |
nothing calls this directly
no test coverage detected