Skip to content

Commit

Permalink
few nil checks added
Browse files Browse the repository at this point in the history
  • Loading branch information
tenplus1 committed Dec 24, 2020
1 parent d795042 commit 43a1ebb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,13 @@ local get_ambience = function(player, tod, name)

pos.y = pos.y + 1.4 -- head level

local nod_head = pplus and playerplus[name].nod_head or minetest.get_node(pos).name
local nod_head = pplus and name and playerplus[name].nod_head or
minetest.get_node(pos).name

pos.y = pos.y - 1.2 -- foot level

local nod_feet = pplus and playerplus[name].nod_feet or minetest.get_node(pos).name
local nod_feet = pplus and name and playerplus[name].nod_feet or
minetest.get_node(pos).name

pos.y = pos.y - 0.2 -- reset pos

Expand Down

0 comments on commit 43a1ebb

Please sign in to comment.