| 77 | } |
| 78 | |
| 79 | int FindGridShift(int x, int z) |
| 80 | { |
| 81 | if ((x / BLOCK(1)) == (z / BLOCK(1))) |
| 82 | return 0; |
| 83 | |
| 84 | if ((z / BLOCK(1)) <= (x / BLOCK(1))) |
| 85 | { |
| 86 | return (-1 - (x & WALL_MASK)); |
| 87 | } |
| 88 | else |
| 89 | { |
| 90 | return ((BLOCK(1) + 1) - (x & WALL_MASK)); |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | // Test if the axis-aligned bounding box collides with geometry at all. |
| 95 | bool TestItemRoomCollisionAABB(ItemInfo* item) |