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

Method ProcessGetIn

engine/Poseidon/AI/AIUnitImpl.cpp:223–391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223bool AIUnit::ProcessGetIn(Transport& veh)
224{
225 if (!IsLocal())
226 {
227 return false;
228 }
229 if (!IsFreeSoldier())
230 {
231 return false;
232 }
233 if (IsPlayer() && veh.GetLock() == LSLocked)
234 {
235 return false;
236 }
237 if (GetGroup()->IsPlayerGroup() && veh.GetLock() == LSLocked)
238 {
239 return false;
240 }
241
242 AIGroup* grp = GetGroup();
243 AI_ERROR(grp);
244 AICenter* center = grp->GetCenter();
245 AI_ERROR(center);
246
247 // avoid get in enemy vehicle
248 if (AvoidBeInWith(center, veh.Commander()))
249 {
250 if (_vehicleAssigned == &veh)
251 {
252 UnassignVehicle();
253 grp->UnassignVehicle(&veh);
254 }
255 return false;
256 }
257 if (AvoidBeInWith(center, veh.Driver()))
258 {
259 if (_vehicleAssigned == &veh)
260 {
261 UnassignVehicle();
262 grp->UnassignVehicle(&veh);
263 }
264 return false;
265 }
266 if (AvoidBeInWith(center, veh.Gunner()))
267 {
268 if (_vehicleAssigned == &veh)
269 {
270 UnassignVehicle();
271 grp->UnassignVehicle(&veh);
272 }
273 return false;
274 }
275 for (int i = 0; i < veh.GetManCargo().Size(); i++)
276 {
277 Person* man = veh.GetManCargo()[i];
278 if (AvoidBeInWith(center, man))
279 {
280 if (_vehicleAssigned == &veh)

Callers 1

GetInGetInFunction · 0.45

Calls 15

GetGroupFunction · 0.85
AvoidBeInWithFunction · 0.85
AllowGetInFunction · 0.85
MoveToGetInPosFunction · 0.85
CreateGetInActionContextFunction · 0.85
GetLockMethod · 0.80
IsPlayerGroupMethod · 0.80
DriverMethod · 0.80
GunnerMethod · 0.80
QIsDriverInMethod · 0.80
GetGroupAssignedMethod · 0.80
QIsCommanderInMethod · 0.80

Tested by

no test coverage detected