This commit is contained in:
aozhiwei 2023-12-29 12:05:27 +08:00
parent f850905c0f
commit 5af1487982

View File

@ -101,9 +101,15 @@ void MapInstance::Init()
}
map_service_ = std::make_shared<MapService>();
grid_service_ = std::make_shared<GridService>();
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);