| 765 | } |
| 766 | |
| 767 | bool IsPointInRoom(const Vector3i& pos, int roomNumber) |
| 768 | { |
| 769 | if (roomNumber < 0 || roomNumber >= g_Level.Rooms.size()) |
| 770 | return false; |
| 771 | |
| 772 | const auto& room = g_Level.Rooms[roomNumber]; |
| 773 | |
| 774 | if (!room.Active()) |
| 775 | return false; |
| 776 | |
| 777 | if (pos.z >= (room.Position.z + BLOCK(1)) && pos.z <= (room.Position.z + BLOCK(room.ZSize - 1)) && |
| 778 | pos.y <= room.BottomHeight && pos.y > room.TopHeight && |
| 779 | pos.x >= (room.Position.x + BLOCK(1)) && pos.x <= (room.Position.x + BLOCK(room.XSize - 1))) |
| 780 | { |
| 781 | return true; |
| 782 | } |
| 783 | |
| 784 | return false; |
| 785 | } |
| 786 | |
| 787 | int FindRoomNumber(const Vector3i& pos, int startRoomNumber, bool onlyNeighbors) |
| 788 | { |
no test coverage detected