Troca de privilegio de acesso para padrão

master
BrunoMine 2017-06-29 11:56:55 -03:00
parent 4b850e6cef
commit 32af53922a
2 changed files with 8 additions and 15 deletions

View File

@ -1,6 +1,6 @@
# Macroloja v1.0.0
# Macroloja v1.0.1
[![Baixar](https://img.shields.io/badge/Baixar-v1.0.0-green.svg)](https://github.com/BrunoMine/macroloja/archive/v1.0.0.zip)
[![Baixar](https://img.shields.io/badge/Baixar-v1.0.1-green.svg)](https://github.com/BrunoMine/macroloja/archive/v1.0.1.zip)
[![Projeto](https://img.shields.io/badge/Git-Projeto-green.svg)](https://github.com/BrunoMine/macroloja)
[![!Bower](https://img.shields.io/badge/Bower-Projeto-green.svg)](https://minetest-bower.herokuapp.com/mods/macroloja)
[![Licença](https://img.shields.io/badge/Licença-LGPL_v3.0-blue.svg)](https://github.com/BrunoMine/macroloja/blob/master/LICENSE)
@ -10,7 +10,7 @@ Adiciona um bau de troca de itens para lojas
## Recursos do projeto
* [Baixar](https://github.com/BrunoMine/macroloja/archive/v1.0.0.zip)
* [Baixar](https://github.com/BrunoMine/macroloja/archive/v1.0.1.zip)
* [Projeto](https://github.com/BrunoMine/macroloja)
* [Bower](https://minetest-bower.herokuapp.com/mods/macroloja)
@ -20,10 +20,6 @@ Adiciona um bau de troca de itens para lojas
* Mod default
* Mod wool
## Privilégios
* `macroloja_admin` : Permite ver baus como administrador
## Licença
Veja LICENSE.txt para informações detalhadas da licença LGPL 3.0

View File

@ -10,9 +10,6 @@
]]
-- Privilegio para administradores verem e mexerem nos baus
minetest.register_privilege("macroloja_admin", "Mexer em todos os baus de venda")
-- Controle de bau acessado
local acesso_bau = {}
@ -177,7 +174,7 @@ minetest.register_node("macroloja:shop", {
can_dig = function(pos, player)
if player:get_player_name() == minetest.get_meta(pos):get_string("dono")
or minetest.check_player_privs(player:get_player_name(), {macroloja_admin=true})
or minetest.check_player_privs(player:get_player_name(), {protection_bypass=true})
then
return true
else
@ -213,7 +210,7 @@ minetest.register_node("macroloja:shop", {
-- Acesso do dono
if name == minetest.get_meta(pos):get_string("dono")
or minetest.check_player_privs(name, {macroloja_admin=true})
or minetest.check_player_privs(name, {protection_bypass=true})
then
-- Exibe formspec
@ -317,17 +314,17 @@ minetest.register_node("macroloja:shop", {
-- Verificar permissão de acesso ao bau
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
if player:get_player_name() == minetest.get_meta(pos):get_string("dono")
or minetest.check_player_privs(player:get_player_name(), {macroloja_admin=true})
or minetest.check_player_privs(player:get_player_name(), {protection_bypass=true})
then return count else return 0 end
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if player:get_player_name() == minetest.get_meta(pos):get_string("dono")
or minetest.check_player_privs(player:get_player_name(), {macroloja_admin=true})
or minetest.check_player_privs(player:get_player_name(), {protection_bypass=true})
then return stack:get_count() else return 0 end
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
if player:get_player_name() == minetest.get_meta(pos):get_string("dono")
or minetest.check_player_privs(player:get_player_name(), {macroloja_admin=true})
or minetest.check_player_privs(player:get_player_name(), {protection_bypass=true})
then return stack:get_count() else return 0 end
end,