fix another spot where nvals_wave might get an out-of-bounds index passed to it. Also fix a spelling error in the lorebooks.

This commit is contained in:
FaceDeer
2023-10-05 22:10:50 -06:00
parent 019853bf4e
commit fec70718b0
4 changed files with 5 additions and 5 deletions

View File

@ -570,7 +570,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
for i = 1, 30 do
local x = math.random(minp.x, maxp.x)
local z = math.random(minp.z, maxp.z)
local index2d = mapgen_helper.index2d(emin, emax, x, z)
local index2d = mapgen_helper.index2d(minp, maxp, x, z)
local abs_cave = math.abs(nvals_cave[index2d]) -- range is from 0 to approximately 2, with 0 being connected and 2s being islands
local wave = nvals_wave[index2d] * wave_mult
local floor_height = math.floor(abs_cave * floor_mult + median + floor_displace + wave)-1
@ -603,7 +603,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
if hunters_enabled then
local x = math.random(minp.x, maxp.x)
local z = math.random(minp.z, maxp.z)
local index2d = mapgen_helper.index2d(emin, emax, x, z)
local index2d = mapgen_helper.index2d(minp, maxp, x, z)
local abs_cave = math.abs(nvals_cave[index2d]) -- range is from 0 to approximately 2, with 0 being connected and 2s being islands
local wave = nvals_wave[index2d] * wave_mult
local floor_height = math.floor(abs_cave * floor_mult + median + floor_displace + wave)-1