From fbc8dcdc4dfce4dbc5275c23ad8e3eb11d1ece79 Mon Sep 17 00:00:00 2001 From: devZoGok Date: Sun, 3 Sep 2023 12:20:39 +0300 Subject: [PATCH] minor fixes --- mapEditorAppState.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mapEditorAppState.cpp b/mapEditorAppState.cpp index c015890..8ad0d1c 100644 --- a/mapEditorAppState.cpp +++ b/mapEditorAppState.cpp @@ -352,7 +352,7 @@ namespace battleship{ for(int k = 0; k < waterCells[i].edges.size(); k++){ Map::Cell adjacentUnderwaterCell = cells[waterCells[i].edges[k].destCellId]; - if(adjacentUnderwaterCell.underWaterCellIds.size() >= j - 1){ + if(adjacentUnderwaterCell.underWaterCellIds.size() >= j + 1){ edges.push_back(Map::Edge(weight, waterCells[i].underWaterCellIds[j], adjacentUnderwaterCell.underWaterCellIds[j])); } } @@ -368,6 +368,7 @@ namespace battleship{ void MapEditorAppState::MapEditor::generateMapScript(){ int numWaterBodies = map->getNodeParent()->getNumChildren() - 1; string mapScript = "map = {\nnumWaterBodies = " + to_string(numWaterBodies) + ",\n"; + mapScript += "size = {x = " + to_string(mapSize.x) + ", y = 100, z = " + to_string(mapSize.y) + "},\n"; mapScript += "impassibleNodeValue = " + to_string(IMPASS_NODE_VAL) + ",\n"; mapScript += "numPlayers = " + to_string(map->getNumPlayers()) + ",\n";