summaryrefslogtreecommitdiff
path: root/objects/room.lua
diff options
context:
space:
mode:
Diffstat (limited to 'objects/room.lua')
-rw-r--r--objects/room.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/objects/room.lua b/objects/room.lua
index 3176e0c..aa77f8d 100644
--- a/objects/room.lua
+++ b/objects/room.lua
@@ -174,7 +174,14 @@ function Room:connect(anotherRoom, way)
-- determine directions
-- if not specified, choose randomly
- local directions = Way[way or Ways[way or utils.any(self:getDoorlessDirections())]]
+ local directions
+ if type(way) == "string" then
+ directions = Way[way]
+ elseif type(way) == "number" then
+ directions = Way[Ways[way]]
+ else
+ directions = Way[Ways[utils.any(self:getDoorlessDirections())]]
+ end
if not directions then return false end
-- connect room with determined direction