1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-17 07:50:29 +01:00

Added NPC's counter adapted to the API

- It seems in fact that sometimes, when you give the fourth diamond to a NPC, it does not follow
  because you're too close to it. (engine's entity issue, or algorythm issue, but not really one
  since you just have to move in 99% of the cases to make the NPC follow you)
This commit is contained in:
LeMagnesium 2015-04-13 21:25:04 +02:00
parent 90dd8dacf4
commit 83b50783c6

View File

@ -87,15 +87,14 @@ mobs:register_mob("mobs:npc", {
local pos = self.object:getpos() local pos = self.object:getpos()
pos.y = pos.y + 0.5 pos.y = pos.y + 0.5
minetest.add_item(pos, {name = mobs.npc_drops[math.random(1,#mobs.npc_drops)]}) minetest.add_item(pos, {name = mobs.npc_drops[math.random(1,#mobs.npc_drops)]})
--[[ elseif item:get_name() == "default:diamond" then elseif item:get_name() == "default:diamond" then
self.diamond_count = (self.diamond_count or 0) + 1 self.diamond_count = (self.diamond_count or 0) + 1
if not minetest.setting_getbool("creative_mode") then if not minetest.setting_getbool("creative_mode") then
item:take_item() item:take_item()
clicker:set_wielded_item(item) clicker:set_wielded_item(item)
end end
if self.diamond_count < 4 then return end if self.diamond_count < 4 then return end
]]--
else
if self.owner == "" then if self.owner == "" then
self.owner = clicker:get_player_name() self.owner = clicker:get_player_name()
else else