Skip to content

Commit

Permalink
code beautification
Browse files Browse the repository at this point in the history
  • Loading branch information
theFox6 committed May 20, 2018
1 parent 1dc482f commit 5c7ccde
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ function working_villages.register_villager(product_name, def)
end

-- register a definition of a new villager.

local villager_def = table.copy(working_villages.villager)
-- basic initial properties
villager_def.hp_max = def.hp_max
Expand Down
10 changes: 5 additions & 5 deletions async_actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function working_villages.villager:go_to(pos)
--print("the first waypiont on his path:" .. minetest.pos_to_string(self.path[1]))
self:change_direction(self.path[1])
self:set_animation(working_villages.animation_frames.WALK)

while #self.path ~= 0 do
self:count_timer("goto_dest:find_path")
self:count_timer("goto_dest:change_dir")
Expand Down Expand Up @@ -78,7 +78,7 @@ function working_villages.villager:place(itemname,pos)
end
end

function working_villages.villager:wait_until_dawn()
function working_villages.villager.wait_until_dawn()
while (minetest.get_timeofday() < 0.2 or minetest.get_timeofday() > 0.76) do
coroutine.yield()
end
Expand All @@ -102,7 +102,7 @@ function working_villages.villager:sleep()
self.pause="sleeping"
self:update_infotext()

self:wait_until_dawn()
self.wait_until_dawn()

local pos=self.object:getpos()
self.object:setpos({x=pos.x,y=pos.y+0.5,z=pos.z})
Expand All @@ -118,14 +118,14 @@ function working_villages.villager:goto_bed()
end
if not self:has_home() then
self:set_animation(working_villages.animation_frames.SIT)
self:wait_until_dawn()
self.wait_until_dawn()
else
local bed_pos = self:get_home():get_bed()
if not bed_pos then
minetest.log("warning","villager couldn't find his bed")
--perhaps go home
self:set_animation(working_villages.animation_frames.SIT)
self:wait_until_dawn()
self.wait_until_dawn()
else
if working_villages.debug_logging then
minetest.log("info","his bed is at:" .. self.destination.x .. ",".. self.destination.y .. ",".. self.destination.z)
Expand Down

0 comments on commit 5c7ccde

Please sign in to comment.