From 32e80312761c0ad30a2b392689f49977bd0ecd15 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 17 Apr 2024 14:15:04 +0800 Subject: [PATCH] 1 --- server/gameserver/gridservice.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/gameserver/gridservice.cc b/server/gameserver/gridservice.cc index bce34543..ac22d8da 100644 --- a/server/gameserver/gridservice.cc +++ b/server/gameserver/gridservice.cc @@ -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) {