Fix bad indents in wielditem mod
This commit is contained in:
parent
5ceecc4e1f
commit
ab2a67fa91
@ -4,14 +4,12 @@
|
|||||||
-- By Kaadmy, for Pixture
|
-- By Kaadmy, for Pixture
|
||||||
--
|
--
|
||||||
|
|
||||||
wielditem = {}
|
local wielditem = {}
|
||||||
|
|
||||||
local update_time = 1
|
local update_time = 1
|
||||||
local timer = 10 -- needs to be more than update_time
|
local timer = 10 -- needs to be more than update_time
|
||||||
|
|
||||||
minetest.register_entity(
|
minetest.register_entity("wielditem:wielditem", {
|
||||||
"wielditem:wielditem",
|
|
||||||
{
|
|
||||||
is_visible = false,
|
is_visible = false,
|
||||||
|
|
||||||
visual = "wielditem",
|
visual = "wielditem",
|
||||||
@ -42,7 +40,6 @@ minetest.register_entity(
|
|||||||
end,
|
end,
|
||||||
on_step = function(self, dtime)
|
on_step = function(self, dtime)
|
||||||
local player = self._wielder
|
local player = self._wielder
|
||||||
|
|
||||||
-- Remove orphan wielditem
|
-- Remove orphan wielditem
|
||||||
if player == nil or (minetest.get_player_by_name(player:get_player_name()) == nil) then
|
if player == nil or (minetest.get_player_by_name(player:get_player_name()) == nil) then
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
@ -76,4 +73,8 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
end, player)
|
end, player)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
minetest.register_on_leaveplayer(function(player)
|
||||||
|
wielditem[name] = nil
|
||||||
|
end)
|
||||||
|
|
||||||
default.log("mod:wielditem", "loaded")
|
default.log("mod:wielditem", "loaded")
|
||||||
|
Loading…
Reference in New Issue
Block a user