1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-06-28 06:11:47 +02:00

passage de variables global en local

passage de variables global en local
This commit is contained in:
2015-01-14 17:33:46 +01:00
committed by LeMagnesium
parent c35814348b
commit 916f3cb093
6 changed files with 20 additions and 20 deletions

View File

@ -3,13 +3,13 @@
minetest.register_globalstep(function(dtime)
local players = minetest.get_connected_players()
for i,player in ipairs(players) do
target = lavatemple.mapgen_data.pos;
local target = lavatemple.mapgen_data.pos;
if not target then return end
pos = player:getpos()
dir = player:get_look_yaw()
local pos = player:getpos()
local dir = player:get_look_yaw()
local angle_north = math.deg(math.atan2(target.x - pos.x, target.z - pos.z))
if angle_north < 0 then angle_north = angle_north + 360 end
angle_dir = 90 - math.deg(dir)
local angle_dir = 90 - math.deg(dir)
local angle_relative = (angle_north - angle_dir) % 360
local compass_image = math.floor((angle_relative/30) + 0.5)%12