Update extender.lua

Add spaces for readability and use 4 space tab
master
shivajiva101 2020-08-27 21:25:39 +01:00 committed by GitHub
parent 30d60bd914
commit af6df74b74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 48 additions and 46 deletions

View File

@ -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