Fix side room door visibility issue in chamber 15, and enforce one doorway per room pair

More doorways can be supported but it complicates the culling logic. It's
easy to work around so leaving unsupported for simplicity until needed.
This commit is contained in:
Matt Penny 2024-08-19 17:19:59 -04:00
parent c3f3e5e191
commit e85ac2fdf1
4 changed files with 11 additions and 0 deletions

View file

@ -25,3 +25,5 @@ Doorways do not need to be linked to a physical door in the world. For example,
they are used for windows so the room on the other side is visible when looking
through. They can also be used to break up large physical spaces into smaller
chunks.
At most one doorway can connect two given rooms.

View file

@ -25,3 +25,5 @@ know their room index, which is updated when passing through
For performance reasons, only the player's current room and those visible
through open doorways are considered for rendering, and only objects in the same
room can collide with each other.
Levels are limited to 64 rooms.

View file

@ -38,6 +38,13 @@ for doorway_index, doorway in pairs(sk_scene.nodes_for_type('@doorway')) do
quad.edgeALength = quad.edgeALength + 1.0
quad.edgeBLength = quad.edgeBLength + 1.0
for _, doorway in pairs(doorways) do
if (doorway[2] == room_a and doorway[3] == room_b) or
(doorway[2] == room_b and doorway[3] == room_a) then
error('At most one doorway can connect two rooms. Found multiple doorways for rooms ' .. room_a .. ' and ' .. room_b .. '.')
end
end
table.insert(doorways, {
quad,
room_a,