Removed some comments and added some comments

This commit is contained in:
Guy Liner 2022-01-06 21:59:59 -05:00
parent ea76517591
commit 838e09105e
1 changed files with 9 additions and 8 deletions

View File

@ -31,7 +31,7 @@ function mcl_playerinfo:collision_detect(pos,player)
local right_ofplayer = pos
local front_ofplayer = pos
local too_close = 1.2
--ytr stands for yaws to radians
local deg = math.deg(player:get_look_horizontal())
local nearme = {x=pos.x,y=pos.y,z=pos.z}
@ -61,23 +61,24 @@ function mcl_playerinfo:collision_detect(pos,player)
local toright = minetest.get_node(right_ofplayer)
local front = minetest.get_node(front_ofplayer)
print('right: '..toright.name)
print('left: '..toleft.name)
print('front: '..front.name)
print(deg)
--minetest.log('right: '..toright.name)
--minetest.log('left: '..toleft.name)
--minetest.log('front: '..front.name)
--minetest.log(deg)
-- Am I touching the cactus? If so, it hurts
local dist_left = vector.distance(pos, left_ofplayer)
local dist_right = vector.distance(pos, right_ofplayer)
local dist_front = vector.distance(pos, front_ofplayer)
if dist_left < too_close and toleft.name ~= "air" then
print("left_close")
--print("left_close")
return false
elseif dist_right < too_close and toright.name ~= "air" then
print("right_close")
--print("right_close")
return false
elseif dist_front < too_close and front.name ~= "air" then
print("front_close")
--print("front_close")
return false
else
return true