This commit is contained in:
aozhiwei 2024-04-17 14:15:04 +08:00
parent aee979052b
commit 32e8031276

View File

@ -30,8 +30,8 @@ void GridService::Init(int width, int height, int cell_width)
map_height_ = height;
cell_width_ = cell_width;
cell_count_per_row_ = (map_height_ / cell_width + 1) + 2;
cell_count_per_col_ = (map_width_ / cell_width + 1) + 2;
cell_count_per_row_ = (map_width_ / cell_width + 1) + 2;
cell_count_per_col_ = (map_height_ / cell_width + 1) + 2;
max_grid_id_ = cell_count_per_row_ * cell_count_per_col_;
cells_.reserve(max_grid_id_ + 1);
for (int i = 0; i < max_grid_id_ + 1; ++i) {