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

Function GetDestroyTarget

engine/Poseidon/AI/AIArcade.cpp:1277–1298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1275// Destroy waypoint
1276
1277static TargetType* GetDestroyTarget(AIGroupContext* context)
1278{
1279 STATE_PREFIX
1280
1281 int& id = context->_fsm->Var(3);
1282 int& idStatic = context->_fsm->Var(2);
1283 EntityAI* target = nullptr;
1284
1285 if (id >= 0 && id < vehiclesMap.Size())
1286 {
1287 target = vehiclesMap[id];
1288 }
1289 else if (idStatic >= 0)
1290 {
1291 target = dyn_cast<TargetType>(GLOB_LAND->FindObject(idStatic));
1292 }
1293 else
1294 {
1295 target = dyn_cast<TargetType>(GLOB_LAND->NearestObject(mission->_destination, 100.0f, TypeVehicle));
1296 }
1297 return target;
1298}
1299
1300static bool CheckArcadeDestroyMoveHelper(AIGroupContext* context)
1301{

Callers 5

ArcadeDestroyBrownFunction · 0.85
CheckArcadeDestroyBrownFunction · 0.85
ArcadeDestroyAttackFunction · 0.85
CheckArcadeDestroyAttackFunction · 0.85

Calls 4

VarMethod · 0.80
NearestObjectMethod · 0.80
SizeMethod · 0.45
FindObjectMethod · 0.45

Tested by

no test coverage detected