mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
fixed sub diving and surrounding cells selection
This commit is contained in:
@@ -383,8 +383,8 @@ namespace battleship{
|
||||
|
||||
vector<int> cellIds;
|
||||
|
||||
for(int i = vertId - numRings; i <= vertId + numRings; i++)
|
||||
for(int j = horId - numRings; j <= horId + numRings; j++)
|
||||
for(int i = max(vertId - numRings, 0); i <= min(vertId + numRings, numVertCells - 1); i++)
|
||||
for(int j = max(horId - numRings, 0); j <= min(horId + numRings, numHorCells - 1); j++)
|
||||
cellIds.push_back(numHorCells * i + j);
|
||||
|
||||
return cellIds;
|
||||
|
||||
Reference in New Issue
Block a user