1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-25 02:00:37 +01:00

[pclasses] Create superuser classes

- Create superuser class 'admin'
- Fix #310
This commit is contained in:
LeMagnesium 2015-10-22 23:16:38 +02:00
parent 731e219fe5
commit 56422e2607
2 changed files with 2 additions and 1 deletions

View File

@ -78,7 +78,7 @@ pclasses.api.util.does_wear_full_armor = function(pname, material, noshield)
end
function pclasses.api.util.can_have_item(pname, itemname)
if not pclasses.data.reserved_items[itemname] then
if not pclasses.data.reserved_items[itemname] or (pclasses.conf.superuser_class and pclasses.api.get_player_class(pname) == pclasses.conf.superuser_class) then
return true
end
for index, class in pairs(pclasses.data.reserved_items[itemname]) do

View File

@ -15,6 +15,7 @@ pclasses.api.util = {}
-- Configuration
pclasses.conf = {}
pclasses.conf.default_class = "adventurer"
pclasses.conf.superuser_class = "admin"
pclasses.conf.save_interval = 3 * 60
pclasses.conf.datafile = minetest.get_worldpath() .. "/pclasses"
pclasses.conf.gravefile = minetest.get_worldpath() .. "/graveyards"