fake player bugfix

This commit is contained in:
Joachim Stolberg 2020-07-29 19:40:52 +02:00
parent 558e69dbfb
commit 8e94e6a2cb
2 changed files with 11 additions and 8 deletions

@ -41,4 +41,5 @@ v0.4 - 16/Apr/2018 - Stem steps added
v0.5 - 17/Apr/2018 - protection bug fixed, further improvements v0.5 - 17/Apr/2018 - protection bug fixed, further improvements
v0.6 - 07/Jan/2020 - screwdriver bugfix v0.6 - 07/Jan/2020 - screwdriver bugfix
v0.7 - 27/May/2020 - ethereal bugfix v0.7 - 27/May/2020 - ethereal bugfix
v0.8 - 29/Jul/2020 - fake player bugfix

@ -156,6 +156,7 @@ end
-- Decrement sapling points -- Decrement sapling points
-- --
local function after_place_sapling(pos, placer) local function after_place_sapling(pos, placer)
if placer and placer:is_player and placer:is_player() and placer:get_attribute then
local points = tonumber(placer:get_attribute("lumberjack_sapl_points") or LUMBERJACK_SAPL_POINTS) local points = tonumber(placer:get_attribute("lumberjack_sapl_points") or LUMBERJACK_SAPL_POINTS)
if points > 0 then if points > 0 then
placer:set_attribute("lumberjack_sapl_points", tostring(points - 1)) placer:set_attribute("lumberjack_sapl_points", tostring(points - 1))
@ -163,6 +164,7 @@ local function after_place_sapling(pos, placer)
if points == 0 then if points == 0 then
check_points(placer) check_points(placer)
end end
end
end end
-- --