refactor: make Tile::getAABB return optional<AABB>

This commit is contained in:
orng
2026-03-28 00:11:19 -05:00
parent 78b5255224
commit 7158fd398f
71 changed files with 205 additions and 139 deletions

View File

@@ -33,9 +33,9 @@ void CactusTile::tick(Level* level, int x, int y, int z, Random* random) {
}
}
AABB* CactusTile::getAABB(Level* level, int x, int y, int z) {
std::optional<AABB> CactusTile::getAABB(Level* level, int x, int y, int z) {
float r = 1 / 16.0f;
return AABB::newTemp(x + r, y, z + r, x + 1 - r, y + 1 - r, z + 1 - r);
return AABB{x + r, static_cast<double>(y), z + r, x + 1 - r, y + 1 - r, z + 1 - r};
}
AABB* CactusTile::getTileAABB(Level* level, int x, int y, int z) {