mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-12-26 05:15:02 +00:00
renamed axes.lua to player.lua
This commit is contained in:
parent
43a59b68ff
commit
8225199520
2 changed files with 8 additions and 2 deletions
|
@ -31,7 +31,7 @@ dofile(wea.modpath.."/utils/nodes.lua")
|
|||
dofile(wea.modpath.."/utils/node_identification.lua")
|
||||
dofile(wea.modpath.."/utils/terrain.lua")
|
||||
dofile(wea.modpath.."/utils/raycast_adv.lua") -- For the farwand
|
||||
dofile(wea.modpath.."/utils/axes.lua")
|
||||
dofile(wea.modpath.."/utils/player.lua") -- Player info functions
|
||||
|
||||
dofile(wea.modpath.."/lib/compat/saplingnames.lua")
|
||||
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
-- Returns the player's position (at leg level).
|
||||
-- @param name string The name of the player to return facing direction of.
|
||||
-- @return Returns position.
|
||||
function worldeditadditions.player_vector(name)
|
||||
return minetest.get_player_by_name(name):get_pos()
|
||||
end
|
||||
-- Returns the player's facing direction on the horizontal axes only.
|
||||
-- @param name string The name of the player to return facing direction of.
|
||||
-- @return Returns axis name and sign multiplier.
|
||||
function worldeditadditions.player_axis2d(name)
|
||||
-- minetest.get_player_by_name("singleplayer"):
|
||||
-- minetest.get_player_by_name("singleplayer"):
|
||||
local dir = minetest.get_player_by_name(name):get_look_dir()
|
||||
local x, z= math.abs(dir.x), math.abs(dir.z)
|
||||
if x > z then return "x", dir.x > 0 and 1 or -1
|
Loading…
Reference in a new issue