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

Method CheckEmpty

engine/Poseidon/AI/AIUnit.cpp:1893–1914  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1891 return CreateNoRoadPath(from, to, fromBuilding, toBuilding);
1892 }
1893 }
1894 if (!GetVehicle()->IsCautious() && CreateRoadPath(from, to))
1895 {
1896 return true;
1897 }
1898 return CreateNoRoadPath(from, to);
1899}
1900
1901bool AIUnit::CheckEmpty(Vector3Par pos)
1902{
1903 EntityAI* veh = GetVehicle();
1904 veh->PerformUnlock();
1905
1906 float xEnd = pos.X();
1907 float zEnd = pos.Z();
1908 int xe = toIntFloor(xEnd * InvOperItemGrid);
1909 int ze = toIntFloor(zEnd * InvOperItemGrid);
1910
1911 int xei = xe / OperItemRange;
1912 int zei = ze / OperItemRange;
1913
1914 const int border = 0;
1915
1916 OperMap map;
1917 map.CreateMap(veh, xei - border, zei - border, xei + border, zei + border);

Callers 3

FindHideBehindMethod · 0.80
UpdateStopModeMethod · 0.80
FindStopPositionMethod · 0.80

Calls 6

PerformUnlockMethod · 0.80
CreateMapMethod · 0.80
PerformLockMethod · 0.80
XMethod · 0.45
ZMethod · 0.45
GetFieldCostMethod · 0.45

Tested by

no test coverage detected