- switched all ownership checks to use player names
This commit is contained in:
Leslie Krause 2019-01-19 12:14:00 -05:00
parent c852d74a2c
commit 5ad8d58ea9
2 changed files with 14 additions and 7 deletions

View File

@ -1,8 +1,12 @@
Giftbox Mod v2.2 Giftbox Mod v2.3
By Leslie E. Krause By Leslie E. Krause
Giftbox provides an assortment user-customizable presents for special occasions, such as
holidays and birthdays, in addition to craftable packages and presents.
https://forum.minetest.net/viewtopic.php?f=9&t=19133 https://forum.minetest.net/viewtopic.php?f=9&t=19133
Repository Repository
---------------------- ----------------------
@ -66,11 +70,14 @@ Version 2.2 (Build 06)
Version 2.2 (Build 07) Version 2.2 (Build 07)
- fixed typo in craft recipe of unsealed package - fixed typo in craft recipe of unsealed package
Version 2.3 (Build 08)
- switched all ownership checks to use player names
Dependencies Dependencies
---------------------- ----------------------
Default Mod (required) Default Mod (required)
https://github.com/minetest/minetest_game/default https://github.com/minetest-game-mods/default
ActiveFormspecs Mod (required) ActiveFormspecs Mod (required)
https://bitbucket.org/sorcerykid/formspecs https://bitbucket.org/sorcerykid/formspecs
@ -86,8 +93,8 @@ Minetest 0.4.15+ required
Installation Installation
---------------------- ----------------------
1) Unzip the archive into the mods directory of your game 1) Unzip the archive into the mods directory of your game.
2) Rename the giftbox-master directory to "giftbox" 2) Rename the giftbox-master directory to "giftbox".
Source Code License Source Code License
---------------------------------------------------------- ----------------------------------------------------------

View File

@ -1,5 +1,5 @@
-------------------------------------------------------- --------------------------------------------------------
-- Minetest :: Giftbox Mod v2.2 (giftbox) -- Minetest :: Giftbox Mod v2.3 (giftbox)
-- --
-- See README.txt for licensing and other information. -- See README.txt for licensing and other information.
-- Copyright (c) 2016-2018, Leslie E. Krause -- Copyright (c) 2016-2018, Leslie E. Krause
@ -335,7 +335,7 @@ for i, color in ipairs( box_colors ) do
"field[1.8,1.9;2.5,0.25;receiver;;" .. meta:get_string( "receiver" ) .. "]" "field[1.8,1.9;2.5,0.25;receiver;;" .. meta:get_string( "receiver" ) .. "]"
-- only placer of gift box should edit properties, not the receiver -- only placer of gift box should edit properties, not the receiver
if default.is_owner( pos, player ) then if default.is_owner( pos, player:get_player_name( ) ) then
return formspec return formspec
end end
end, end,
@ -344,7 +344,7 @@ for i, color in ipairs( box_colors ) do
local meta = minetest.get_meta( pos ) local meta = minetest.get_meta( pos )
-- only placer of gift box should edit properties, not the receiver -- only placer of gift box should edit properties, not the receiver
if not default.is_owner( pos, player ) then return end if not default.is_owner( pos, owner ) then return end
if fields.is_anonymous then if fields.is_anonymous then
-- in next version of active formspecs, we should save checkbox state -- in next version of active formspecs, we should save checkbox state