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

Method ExposureChanged

engine/Poseidon/AI/AIUnit.cpp:1451–1463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1449 }
1450 else
1451 {
1452 RefreshStrategicPlan();
1453 }
1454}
1455
1456void AIUnit::ExposureChanged(int x, int z, float optimistic, float pessimistic)
1457{
1458 float exposure = IsHoldingFire() ? fabs(pessimistic) : fabs(optimistic);
1459 if (exposure < VALID_EXPOSURE_CHANGE)
1460 {
1461 return;
1462 }
1463
1464 if (_planner->IsOnPath(x, z, _planner->FindBestIndex(Position()), _planner->GetPlanSize() - 1))
1465 {
1466 _exposureChange += exposure;

Callers 1

UpdateFieldMethod · 0.45

Calls 4

fabsFunction · 0.85
IsOnPathMethod · 0.80
FindBestIndexMethod · 0.80
GetPlanSizeMethod · 0.80

Tested by

no test coverage detected