fixed underwater cells calculation

code cleanup
This commit is contained in:
devZoGok
2026-04-26 17:50:59 +03:00
parent 8b180181d2
commit dc036748e3
12 changed files with 128802 additions and 140007 deletions
+1 -6
View File
@@ -586,9 +586,8 @@ namespace battleship{
}
void Map::calculateRegions(){
int nextCellId = 0;
bool allCellsInRegions = false;
int numSurfaceCells = (int(mapSize.x / CELL_SIZE.x)) * (int(mapSize.z / CELL_SIZE.z));
int nextCellId = 0, numSurfaceCells = (int(mapSize.x / CELL_SIZE.x)) * (int(mapSize.z / CELL_SIZE.z));
while(!allCellsInRegions){
vector<Map::Cell*> regionCells;
@@ -630,10 +629,6 @@ namespace battleship{
}
}
bool Map::regionContainsCell(int regId, int cellId){
return find(regions[regId].second.begin(), regions[regId].second.end(), &cells[cellId]) != regions[regId].second.end();
}
void Map::load(string mapName){
this->mapName = mapName;