mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-05 06:53:52 +01:00
dir function rename
This commit is contained in:
parent
134d2b0999
commit
866748a5c3
@ -22,7 +22,7 @@ end
|
|||||||
-- @param name string The name of the player to return facing direction of.
|
-- @param name string The name of the player to return facing direction of.
|
||||||
-- @param dir string Relative direction to translate.
|
-- @param dir string Relative direction to translate.
|
||||||
-- @return Returns axis name and sign multiplier.
|
-- @return Returns axis name and sign multiplier.
|
||||||
function worldeditadditions.xlate_dir(name, dir)
|
function worldeditadditions.dir_to_xyz(name, dir)
|
||||||
local axfac, drfac = worldeditadditions.player_axis2d(name)
|
local axfac, drfac = worldeditadditions.player_axis2d(name)
|
||||||
local _, axlft, drlft = worldeditadditions.axis_left(axfac,drfac)
|
local _, axlft, drlft = worldeditadditions.axis_left(axfac,drfac)
|
||||||
if dir:match("front") or dir:match("back") then
|
if dir:match("front") or dir:match("back") then
|
||||||
|
@ -13,7 +13,7 @@ local function parse_with_name(name,args)
|
|||||||
tmp.ax = tmp.proc:match("[xyz]")
|
tmp.ax = tmp.proc:match("[xyz]")
|
||||||
tmp.dir = tonumber(tmp.proc:match("[+-]?%d+")) * (tmp.proc:match("-%l+") and -1 or 1)
|
tmp.dir = tonumber(tmp.proc:match("[+-]?%d+")) * (tmp.proc:match("-%l+") and -1 or 1)
|
||||||
else
|
else
|
||||||
tmp.ax, _ = wea.xlate_dir(name, tmp.proc:match("%l+"))
|
tmp.ax, _ = wea.dir_to_xyz(name, tmp.proc:match("%l+"))
|
||||||
if not tmp.ax then return false, _ end
|
if not tmp.ax then return false, _ end
|
||||||
tmp.dir = tonumber(tmp.proc:match("[+-]?%d+")) * (tmp.proc:match("-%l+") and -1 or 1) * _
|
tmp.dir = tonumber(tmp.proc:match("[+-]?%d+")) * (tmp.proc:match("-%l+") and -1 or 1) * _
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user