| 82 | } |
| 83 | |
| 84 | bool cRandomMap::CheckRadiusFeatures(const std::vector<eTerrainFeature> &pTypes, cPosition* pPosition, int32 pRadius) { |
| 85 | for (int32 x = pPosition->mX - pRadius; x < pPosition->mX + pRadius; x++) { |
| 86 | if (x < 0) |
| 87 | continue; |
| 88 | |
| 89 | int32 yspan = (int32) (pRadius * sin(acos((pPosition->mX - x) / pRadius))); |
| 90 | for (int32 y = pPosition->mY - yspan; y < pPosition->mY + yspan; y++) { |
| 91 | if (y < 0) |
| 92 | continue; |
| 93 | |
| 94 | int32 Terrain = g_Fodder->Map_Terrain_Get(x, y); |
| 95 | if (std::find(pTypes.begin(), pTypes.end(), Terrain) == pTypes.end()) |
| 96 | return false; |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | return true; |
| 101 | } |
| 102 | |
| 103 | bool cRandomMap::CheckRadiusSprites(cPosition* pPosition, int32 pRadius) { |
| 104 |
nothing calls this directly
no test coverage detected