parent
30d60bd914
commit
af6df74b74
|
@ -67,9 +67,11 @@ local function load_schematic(value)
|
|||
-- This is broken for larger tables in the current version of LuaJIT
|
||||
nodes = minetest.deserialize(content)
|
||||
else
|
||||
-- XXX: This is a filthy hack that works surprisingly well - in LuaJIT, `minetest.deserialize` will fail due to the register limit
|
||||
-- XXX: This is a filthy hack that works surprisingly well - in LuaJIT,
|
||||
-- `minetest.deserialize` will fail due to the register limit
|
||||
content = content:gsub("return%s*{", "", 1):gsub("}%s*$", "", 1) -- remove the starting and ending values to leave only the node data
|
||||
local escaped = content:gsub("\\\\", "@@"):gsub("\\\"", "@@"):gsub("(\"[^\"]*\")", function(s) return string.rep("@", #s) end)
|
||||
local escaped = content:gsub("\\\\", "@@"):gsub(
|
||||
"\\\"", "@@"):gsub("(\"[^\"] * \")", function(s) return string.rep("@", #s) end)
|
||||
local startpos, startpos1, endpos = 1, 1
|
||||
while true do -- go through each individual node entry (except the last)
|
||||
startpos, endpos = escaped:find("},%s*{", startpos)
|
||||
|
@ -331,7 +333,7 @@ function eggwars.clear_nodes(pos1, pos2)
|
|||
"group:crumbly",
|
||||
"group:oddly_breakable_by_hand"
|
||||
}
|
||||
local slices = region_slicer(pos1, pos2, 'y')
|
||||
local slices = region_slicer(p1, p2, 'y')
|
||||
local n = 0
|
||||
|
||||
for _, slice in ipairs(slices) do
|
||||
|
|
Loading…
Reference in New Issue