MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / getTerrainLevel

Method getTerrainLevel

src/Battlescape/Map.cpp:1327–1342  ·  view source on GitHub ↗

* Terrainlevel goes from 0 to -24. For a larger sized unit, we need to pick the heighest terrain level, which is the lowest number... * @param pos Position. * @param size Size of the unit we want to get the level from. * @return terrainlevel. */

Source from the content-addressed store, hash-verified

1325 * @return terrainlevel.
1326 */
1327int Map::getTerrainLevel(Position pos, int size)
1328{
1329 int lowestlevel = 0;
1330
1331 for (int x = 0; x < size; x++)
1332 {
1333 for (int y = 0; y < size; y++)
1334 {
1335 int l = _save->getTile(pos + Position(x,y,0))->getTerrainLevel();
1336 if (l < lowestlevel)
1337 lowestlevel = l;
1338 }
1339 }
1340
1341 return lowestlevel;
1342}
1343
1344/**
1345 * Sets the 3D cursor to selection/aim mode.

Callers 15

thinkMethod · 0.45
setupAmbushMethod · 0.45
findFirePointMethod · 0.45
grenadeActionMethod · 0.45
drawTerrainMethod · 0.45
initMethod · 0.45
validThrowRangeMethod · 0.45
performMeleeAttackMethod · 0.45
thinkMethod · 0.45
calculateMethod · 0.45
getTUCostMethod · 0.45
isOnStairsMethod · 0.45

Calls 2

PositionClass · 0.70
getTileMethod · 0.45

Tested by

no test coverage detected