Fix shutdown on player leave/cozylights
This commit is contained in:
parent
7695674991
commit
0348dc2703
1 changed files with 8 additions and 6 deletions
|
@ -562,12 +562,14 @@ minetest.register_globalstep(function(dtime)
|
|||
for _,cozyplayer in pairs(cozylights.cozyplayers) do
|
||||
local t = os.clock()
|
||||
local player = minetest.get_player_by_name(cozyplayer.name)
|
||||
local pos = vector.round(player:getpos())
|
||||
pos.y = pos.y + 1
|
||||
local wield_name = player:get_wielded_item():get_name()
|
||||
--todo: checking against a string is expensive, what do
|
||||
if wield_name == "cozylights:light_brush" then
|
||||
on_brush_hold(player,cozyplayer,pos,t)
|
||||
if not player == nil then
|
||||
local pos = vector.round(player:getpos())
|
||||
pos.y = pos.y + 1
|
||||
local wield_name = player:get_wielded_item():get_name()
|
||||
--todo: checking against a string is expensive, what do
|
||||
if wield_name == "cozylights:light_brush" then
|
||||
on_brush_hold(player,cozyplayer,pos,t)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue