From 5ad8d58ea9823530d844fb0e528e3ab2bb3a0fbe Mon Sep 17 00:00:00 2001 From: Leslie Krause Date: Sat, 19 Jan 2019 12:14:00 -0500 Subject: [PATCH] Build 08 - switched all ownership checks to use player names --- README.txt | 15 +++++++++++---- init.lua | 6 +++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.txt b/README.txt index 52f6812..62c7797 100644 --- a/README.txt +++ b/README.txt @@ -1,8 +1,12 @@ -Giftbox Mod v2.2 +Giftbox Mod v2.3 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 + Repository ---------------------- @@ -66,11 +70,14 @@ Version 2.2 (Build 06) Version 2.2 (Build 07) - fixed typo in craft recipe of unsealed package +Version 2.3 (Build 08) + - switched all ownership checks to use player names + Dependencies ---------------------- Default Mod (required) - https://github.com/minetest/minetest_game/default + https://github.com/minetest-game-mods/default ActiveFormspecs Mod (required) https://bitbucket.org/sorcerykid/formspecs @@ -86,8 +93,8 @@ Minetest 0.4.15+ required Installation ---------------------- - 1) Unzip the archive into the mods directory of your game - 2) Rename the giftbox-master directory to "giftbox" + 1) Unzip the archive into the mods directory of your game. + 2) Rename the giftbox-master directory to "giftbox". Source Code License ---------------------------------------------------------- diff --git a/init.lua b/init.lua index 0c42351..6a64582 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,5 @@ -------------------------------------------------------- --- Minetest :: Giftbox Mod v2.2 (giftbox) +-- Minetest :: Giftbox Mod v2.3 (giftbox) -- -- See README.txt for licensing and other information. -- 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" ) .. "]" -- 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 end end, @@ -344,7 +344,7 @@ for i, color in ipairs( box_colors ) do local meta = minetest.get_meta( pos ) -- 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 -- in next version of active formspecs, we should save checkbox state