This commit is contained in:
aozhiwei 2023-05-04 17:26:59 +08:00
parent 615466a157
commit 20854df140
2 changed files with 15 additions and 6 deletions

View File

@ -20,10 +20,6 @@ MapService::MapService()
MapService::~MapService()
{
if (map_cells_) {
free(map_cells_);
map_cells_ = nullptr;
}
}
void MapService::Init(int width, int height, int cell_width)
@ -57,7 +53,20 @@ void MapService::Init(int width, int height, int cell_width)
void MapService::UnInit()
{
for (int i = 0; i < max_grid_id_; ++i) {
list_head* head = &map_cells_[i];
while (!list_empty(head)) {
CellNode* e = list_first_entry(head,
CellNode,
entry);
list_del_init(&e->entry);
delete e;
}
}
if (map_cells_) {
free(map_cells_);
map_cells_ = nullptr;
}
}
bool MapService::CanAdd(const glm::vec3& pos, int rad)

2
third_party/a8 vendored

@ -1 +1 @@
Subproject commit 1e577389c8a2870db9ddbf18577bfca24def049b
Subproject commit 54fe50edf11dda774dcd6fc480134c9e4ce449cd