mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-01 07:13:45 +01:00
Refactor mcl_dungeons
This commit is contained in:
parent
4625d2e8f8
commit
99a54319b1
@ -153,8 +153,12 @@ minetest.register_on_generated(function(minp, maxp)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Check conditions. If okay, start generating
|
-- Check conditions. If okay, start generating
|
||||||
|
if ceilingfloor_ok and openings >= 1 and openings <= 5 then
|
||||||
|
-- Okay! Spawning starts!
|
||||||
|
|
||||||
|
-- First prepare random chest positions.
|
||||||
|
-- Chests spawn at wall
|
||||||
|
|
||||||
-- But prepare random chest positions beforehand
|
|
||||||
-- We assign each position at the wall a number and each chest gets one of these numbers randomly
|
-- We assign each position at the wall a number and each chest gets one of these numbers randomly
|
||||||
local totalChests = 2
|
local totalChests = 2
|
||||||
local totalChestSlots = (dim.x-1) * (dim.z-1)
|
local totalChestSlots = (dim.x-1) * (dim.z-1)
|
||||||
@ -177,7 +181,6 @@ minetest.register_on_generated(function(minp, maxp)
|
|||||||
table.sort(chestSlots)
|
table.sort(chestSlots)
|
||||||
local currentChest = 1
|
local currentChest = 1
|
||||||
|
|
||||||
if ceilingfloor_ok and openings >= 1 and openings <= 5 then
|
|
||||||
-- Ceiling and floor
|
-- Ceiling and floor
|
||||||
local maxx, maxy, maxz = x+dim.x+1, y+dim.y+1, z+dim.z+1
|
local maxx, maxy, maxz = x+dim.x+1, y+dim.y+1, z+dim.z+1
|
||||||
local chestSlotCounter = 1
|
local chestSlotCounter = 1
|
||||||
|
Loading…
Reference in New Issue
Block a user