From a7b45cbba7f1dcaa2489f046b4f0e200972bfba9 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 24 Aug 2019 23:19:41 +0200 Subject: [PATCH] Implement stype restriction --- room.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/room.lua b/room.lua index 8cf69b9..7c03cb0 100644 --- a/room.lua +++ b/room.lua @@ -896,6 +896,20 @@ function tsm_pyramids.make_room(pos, stype, room_id, rotations) return false, S("Incorrect room type ID: @1", room_id) end local room = table.copy(room_types[room_id]) + local tries = 0 + while tries < #room_types do + if room.stype and room.stype ~= stype then + minetest.log("error", "stype does not fit: room_id="..room_id.."! trying new room id...") + room_id = room_id + 1 + if room_id > #room_types then + room_id = 1 + end + room = table.copy(room_types[room_id]) + else + break + end + tries = tries + 1 + end local chests = {} local column_style if stype == "desert_stone" then @@ -931,7 +945,6 @@ function tsm_pyramids.make_room(pos, stype, room_id, rotations) end elseif room.style == "stacked" then -- TODO: Implement wall designs - -- TODO: Fix room height settings local layout_list = room.layout local layout local layout_offset = room.layout_offset