MCPcopy Create free account
hub / github.com/ddnet/ddnet / GetGameAreaDistance

Function GetGameAreaDistance

src/tools/map_replace_area.cpp:591–604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589}
590
591void GetGameAreaDistance(const float aaaGameAreas[2][2][2], const CMapObject aObs[2], const float aaaVisibleAreas[2][2][2], float aDistance[2])
592{
593 for(int i = 0; i < 2; i++)
594 {
595 if(aObs[0].m_aSpeed[i] == 1 && aObs[1].m_aSpeed[i] == 1)
596 aDistance[i] = 0;
597 else if(aObs[0].m_aSpeed[i] == 1 && aObs[1].m_aSpeed[i] != 1)
598 aDistance[i] = aaaGameAreas[1][i][0] - aaaVisibleAreas[0][i][0];
599 else if(aObs[0].m_aSpeed[i] != 1 && aObs[1].m_aSpeed[i] == 1)
600 aDistance[i] = aaaVisibleAreas[1][i][0] - aaaGameAreas[0][i][0];
601 else
602 aDistance[i] = aaaGameAreas[1][i][0] - aaaGameAreas[0][i][0];
603 }
604}
605
606void GetGameAreaDistance(const float aaaGameAreas[2][2][2], const CMapObject aObs[2], const float aaVisibleArea[2][2], float aDistance[2])
607{

Callers 3

AdaptVisibleAreasFunction · 0.85
AdaptReplaceableAreasFunction · 0.85
AdaptVisiblePointFunction · 0.85

Calls 1

mem_copyFunction · 0.85

Tested by

no test coverage detected