diff --git a/server/gameserver/mapinstance.cc b/server/gameserver/mapinstance.cc index 09f7628f..f6207d6e 100644 --- a/server/gameserver/mapinstance.cc +++ b/server/gameserver/mapinstance.cc @@ -101,9 +101,15 @@ void MapInstance::Init() } map_service_ = std::make_shared(); grid_service_ = std::make_shared(); - grid_service_->Init(map_meta_->map_width(), - map_meta_->map_height(), - mt::Param::s().map_cell_width); + if (map_meta_->is_moba()) { + grid_service_->Init(map_meta_->map_width(), + map_meta_->map_height(), + std::max(map_meta_->map_width(), map_meta_->map_height()) + 0); + } else { + grid_service_->Init(map_meta_->map_width(), + map_meta_->map_height(), + mt::Param::s().map_cell_width); + } map_service_->Init(map_meta_->map_width() / MAP_GRID_WIDTH, map_meta_->map_height() / MAP_GRID_WIDTH, MAP_GRID_WIDTH);