Bugfix for correct timerand entity parameters

This commit is contained in:
Hector Franqui 2016-11-14 18:39:41 -05:00
parent 9ee5c186f1
commit 7d85cdc063

19
npc.lua
View File

@ -427,6 +427,15 @@ mobs:register_mob("advanced_npc:npc", {
end end
end, end,
do_custom = function(self, dtime)
-- Timer function for gifts
if self.gift_data.gift_timer_value < self.gift_data.gift_interval then
self.gift_data.gift_timer_value = self.gift_data.gift_timer_value + dtime
minetest.log(dump(self.gift_data.gift_timer_value))
end
end
}) })
-- This function checks for "female" text on the texture name -- This function checks for "female" text on the texture name
@ -461,18 +470,12 @@ local function npc_spawn(self, pos)
gift_timer_value = 0 gift_timer_value = 0
} }
-- Timer function for gifts
ent.on_step = function(self, dtime)
if self.gift_data.gift_timer_value < self.gift_data.gift_interval then
self.gift_data.gift_timer_value = self.gift_data.gift_timer_value + dtime
minetest.log(dump(self.gift_data.gift_timer_value))
end
end
-- Initialize relationships object -- Initialize relationships object
ent.relationships = {} ent.relationships = {}
minetest.log(dump(ent)) minetest.log(dump(ent))
ent.object:set_properties(ent)
end end
-- Spawn -- Spawn