projects
/
oweals
/
minetest_game.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c2d1a5e
)
Fix owner not being checked on write to book
author
rubenwardy
<rubenwardy@gmail.com>
Tue, 25 Apr 2017 23:15:15 +0000
(
00:15
+0100)
committer
rubenwardy
<rubenwardy@gmail.com>
Thu, 27 Apr 2017 01:28:23 +0000
(
02:28
+0100)
mods/default/craftitems.lua
patch
|
blob
|
history
diff --git
a/mods/default/craftitems.lua
b/mods/default/craftitems.lua
index 0c42fc37806077cb85232711f235f882a411fbd7..75ac5507042ccbb9dfe1224e980a87e3a5742bba 100644
(file)
--- a/
mods/default/craftitems.lua
+++ b/
mods/default/craftitems.lua
@@
-12,6
+12,7
@@
minetest.register_craftitem("default:paper", {
groups = {flammable = 3},
})
+
local lpp = 14 -- Lines per book's page
local function book_on_use(itemstack, user)
local player_name = user:get_player_name()
@@
-93,6
+94,10
@@
minetest.register_on_player_receive_fields(function(player, formname, fields)
data = stack:get_meta():to_table().fields
end
+ if data and data.owner and data.owner ~= player:get_player_name() then
+ return
+ end
+
if not data then data = {} end
data.title = fields.title
data.owner = player:get_player_name()