mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
fixed underwater cells calculation
code cleanup
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user