forked from your-land-mirror/yl_speak_up
used yl_speak_up.log_change where appropriate
This commit is contained in:
parent
32a0613780
commit
8aad949ee2
@ -193,20 +193,18 @@ yl_speak_up.load_npc_inventory = function(n_id)
|
|||||||
|
|
||||||
-- log inventory changes (same way as modifications to chest inventories)
|
-- log inventory changes (same way as modifications to chest inventories)
|
||||||
on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
|
on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
|
||||||
minetest.log("action", "(yl_speak_up) "..player:get_player_name() ..
|
yl_speak_up.log_change(player:get_player_name(), n_id,
|
||||||
" moves stuff in inventory of NPC " .. tostring(n_id))
|
"moves stuff inside inventory of NPC")
|
||||||
|
|
||||||
end,
|
end,
|
||||||
on_put = function(inv, listname, index, stack, player)
|
on_put = function(inv, listname, index, stack, player)
|
||||||
minetest.log("action", "(yl_speak_up) "..player:get_player_name() ..
|
yl_speak_up.log_change(player:get_player_name(), n_id,
|
||||||
" moves " .. stack:get_name() ..
|
"adds "..tostring(stack:to_string()).." to inventory of NPC")
|
||||||
" to inventory of NPC " .. tostring(n_id))
|
|
||||||
|
|
||||||
end,
|
end,
|
||||||
on_take = function(inv, listname, index, stack, player)
|
on_take = function(inv, listname, index, stack, player)
|
||||||
minetest.log("action", "(yl_speak_up) "..player:get_player_name() ..
|
yl_speak_up.log_change(player:get_player_name(), n_id,
|
||||||
" takes " .. stack:get_name() ..
|
"takes "..tostring(stack:to_string()).." from inventory of NPC")
|
||||||
" from inventory of NPC " .. tostring(n_id))
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
-- the NPC needs enough room for trade items, payment and questitems
|
-- the NPC needs enough room for trade items, payment and questitems
|
||||||
|
@ -62,10 +62,8 @@ yl_speak_up.npc_has_priv = function(n_id, priv_name, generic_npc_id)
|
|||||||
end
|
end
|
||||||
if(not(yl_speak_up.npc_priv_table[n_id])
|
if(not(yl_speak_up.npc_priv_table[n_id])
|
||||||
or not(yl_speak_up.npc_priv_table[n_id][priv_name])) then
|
or not(yl_speak_up.npc_priv_table[n_id][priv_name])) then
|
||||||
minetest.log(
|
yl_speak_up.log_change("-", n_id,
|
||||||
"action",
|
"error: NPC was denied priv priv "..tostring(priv_name)..".")
|
||||||
"[MOD] yl_speak_up: NPC with ID "..tostring(n_id)..
|
|
||||||
" was denied the NPC priv "..tostring(priv_name)..".")
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user