mirror of
https://github.com/minetest-mods/nether.git
synced 2024-12-28 20:00:30 +01:00
Merge pull request #24 from Treer/bugfix/OutOfMemory
Fix Out Of Memory issue
This commit is contained in:
commit
5cb9e5fb27
@ -196,8 +196,8 @@ local np_cave = {
|
|||||||
-- Buffers and objects we shouldn't recreate every on_generate
|
-- Buffers and objects we shouldn't recreate every on_generate
|
||||||
|
|
||||||
local nobj_cave = nil
|
local nobj_cave = nil
|
||||||
local nbuf_cave = nil
|
local nbuf_cave = {}
|
||||||
local dbuf = nil
|
local dbuf = {}
|
||||||
|
|
||||||
local yblmin = NETHER_FLOOR + BLEND * 2
|
local yblmin = NETHER_FLOOR + BLEND * 2
|
||||||
local yblmax = NETHER_CEILING - BLEND * 2
|
local yblmax = NETHER_CEILING - BLEND * 2
|
||||||
@ -415,7 +415,7 @@ local function on_generated(minp, maxp, seed)
|
|||||||
local chulens = {x = yCaveStride, y = yCaveStride, z = yCaveStride}
|
local chulens = {x = yCaveStride, y = yCaveStride, z = yCaveStride}
|
||||||
|
|
||||||
nobj_cave = nobj_cave or minetest.get_perlin_map(np_cave, chulens)
|
nobj_cave = nobj_cave or minetest.get_perlin_map(np_cave, chulens)
|
||||||
local nvals_cave = nobj_cave:get3dMap_flat(minp, nbuf_cave)
|
local nvals_cave = nobj_cave:get_3d_map_flat(minp, nbuf_cave)
|
||||||
|
|
||||||
|
|
||||||
local dungeonRooms = build_dungeon_room_list(data, area)
|
local dungeonRooms = build_dungeon_room_list(data, area)
|
||||||
|
@ -56,8 +56,8 @@ dofile(nether.path .. "/mapgen_decorations.lua")
|
|||||||
-- Initialize noise object, localise noise and data buffers
|
-- Initialize noise object, localise noise and data buffers
|
||||||
|
|
||||||
local nobj_cave = nil
|
local nobj_cave = nil
|
||||||
local nbuf_cave = nil
|
local nbuf_cave = {}
|
||||||
local dbuf = nil
|
local dbuf = {}
|
||||||
|
|
||||||
|
|
||||||
-- Content ids
|
-- Content ids
|
||||||
@ -122,7 +122,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
|
|||||||
local minposxyz = {x = x0, y = y0, z = z0}
|
local minposxyz = {x = x0, y = y0, z = z0}
|
||||||
|
|
||||||
nobj_cave = nobj_cave or minetest.get_perlin_map(np_cave, chulens)
|
nobj_cave = nobj_cave or minetest.get_perlin_map(np_cave, chulens)
|
||||||
local nvals_cave = nobj_cave:get3dMap_flat(minposxyz, nbuf_cave)
|
local nvals_cave = nobj_cave:get_3d_map_flat(minposxyz, nbuf_cave)
|
||||||
|
|
||||||
for y = y00, y11 do -- Y loop first to minimise tcave calculations
|
for y = y00, y11 do -- Y loop first to minimise tcave calculations
|
||||||
local tcave
|
local tcave
|
||||||
|
Loading…
Reference in New Issue
Block a user