aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorParamat <paramat@users.noreply.github.com>2018-09-23 21:06:51 +0100
committerGitHub <noreply@github.com>2018-09-23 21:06:51 +0100
commit4a2a11262b0821d0bcddd25161f5eb8b172b23fd (patch)
tree22268479f931bc2eda49bb74278d1be55e67e28c /builtin
parent8543df7752bfdd43922f8f9377cd94aae71d83b9 (diff)
downloadminetest-4a2a11262b0821d0bcddd25161f5eb8b172b23fd.tar.gz
minetest-4a2a11262b0821d0bcddd25161f5eb8b172b23fd.tar.bz2
minetest-4a2a11262b0821d0bcddd25161f5eb8b172b23fd.zip
Builtin//misc_helpers: Various fixes (#7737)
Remove unused variable 'seplen'. Fix 'cparam2'->'param2'. Do not initialise variable 'p' twice.
Diffstat (limited to 'builtin')
-rw-r--r--builtin/common/misc_helpers.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/common/misc_helpers.lua b/builtin/common/misc_helpers.lua
index 23b00eafe..d7f51f072 100644
--- a/builtin/common/misc_helpers.lua
+++ b/builtin/common/misc_helpers.lua
@@ -168,7 +168,7 @@ function string.split(str, delim, include_empty, max_splits, sep_is_pattern)
delim = delim or ","
max_splits = max_splits or -1
local items = {}
- local pos, len, seplen = 1, #str, #delim
+ local pos, len = 1, #str
local plain = not sep_is_pattern
max_splits = max_splits + 1
repeat
@@ -382,7 +382,7 @@ if INIT == "game" then
param2 = dirs1[fdir + 1]
elseif isceiling then
if orient_flags.force_facedir then
- cparam2 = 20
+ param2 = 20
else
param2 = dirs2[fdir + 1]
end
@@ -495,7 +495,7 @@ function core.string_to_pos(value)
p.z = tonumber(p.z)
return p
end
- local p = {}
+ p = {}
p.x, p.y, p.z = string.match(value, "^%( *([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+) *%)$")
if p.x and p.y and p.z then
p.x = tonumber(p.x)