TODO: Can use floordata's GetRoomGridCoord()?
| 752 | { |
| 753 | // TODO: Can use floordata's GetRoomGridCoord()? |
| 754 | FloorInfo* GetSector(RoomData* room, int x, int z) |
| 755 | { |
| 756 | int sectorX = std::clamp(x / BLOCK(1), 0, room->XSize - 1); |
| 757 | int sectorZ = std::clamp(z / BLOCK(1), 0, room->ZSize - 1); |
| 758 | |
| 759 | int sectorID = sectorZ + (sectorX * room->ZSize); |
| 760 | if (sectorID > room->Sectors.size()) |
| 761 | return nullptr; |
| 762 | |
| 763 | return &room->Sectors[sectorID]; |
| 764 | } |
| 765 | } |
| 766 | |
| 767 | bool IsPointInRoom(const Vector3i& pos, int roomNumber) |
no test coverage detected