forked from VoxeLibre/VoxeLibre
fix formatting || compass_image local
This commit is contained in:
parent
5c8f94d620
commit
0c2562b88c
|
@ -14,8 +14,6 @@ local random_timer_trigger = 0.5 -- random compass spinning tick in seconds. Inc
|
||||||
local random_frame = math.random(0, compass_frames-1)
|
local random_frame = math.random(0, compass_frames-1)
|
||||||
|
|
||||||
function mcl_compass.get_compass_image(pos, dir, itemstack)
|
function mcl_compass.get_compass_image(pos, dir, itemstack)
|
||||||
local compass_image = ""
|
|
||||||
-- Compasses do not work in certain zones
|
|
||||||
local lodestone_pos = minetest.string_to_pos(itemstack:get_meta():get_string("pointsto"))
|
local lodestone_pos = minetest.string_to_pos(itemstack:get_meta():get_string("pointsto"))
|
||||||
|
|
||||||
if lodestone_pos then --lodestone meta present
|
if lodestone_pos then --lodestone meta present
|
||||||
|
@ -80,15 +78,15 @@ minetest.register_globalstep(function(dtime)
|
||||||
local pos = player:get_pos()
|
local pos = player:get_pos()
|
||||||
|
|
||||||
for j,stack in pairs(player:get_inventory():get_list("main")) do
|
for j,stack in pairs(player:get_inventory():get_list("main")) do
|
||||||
compass_image = mcl_compass.get_compass_image(pos, player:get_look_horizontal(), stack)
|
if minetest.get_item_group(stack:get_name(), "compass") ~= 0 then
|
||||||
|
local compass_image = mcl_compass.get_compass_image(pos, player:get_look_horizontal(), stack)
|
||||||
|
if minetest.get_item_group(stack:get_name(), "compass")-1 ~= compass_image then
|
||||||
if minetest.get_item_group(stack:get_name(), "compass") ~= 0 and
|
|
||||||
minetest.get_item_group(stack:get_name(), "compass")-1 ~= compass_image then
|
|
||||||
local itemname = "mcl_compass:"..compass_image
|
local itemname = "mcl_compass:"..compass_image
|
||||||
stack:set_name(itemname)
|
stack:set_name(itemname)
|
||||||
player:get_inventory():set_stack("main", j, stack)
|
player:get_inventory():set_stack("main", j, stack)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue