修复0宽高物件碰撞问题

This commit is contained in:
aozhiwei 2021-10-26 15:16:56 +08:00
parent 79c355239c
commit 34264ab423
2 changed files with 9 additions and 0 deletions

View File

@ -193,6 +193,9 @@ void MapService::GetColliders(Room* room,
}
struct CellNode *node, *tmp;
list_for_each_entry_safe(node, tmp, head, entry) {
if (!node->collider->active) {
continue;
}
if (node->collider->tag != 0 && !a8::HasBitFlag(node->collider->tag, kHalfWallTag)) {
continue;
}

View File

@ -115,6 +115,12 @@ void Obstacle::RecalcSelfCollider()
if (IsHalfWallCollider()) {
a8::SetBitFlag(collider->tag, kHalfWallTag);
}
#if 1
//长宽为0的物件
if (meta->i->width() <= 0 && meta->i->height() <= 0) {
collider->active = false;
}
#endif
}
}