1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-18 00:08:25 +01:00

Added globalstep to assign classes

- 3d_armor doesn't depend anymore on pclasses (#159)
This commit is contained in:
LeMagnesium 2015-07-28 18:05:01 +02:00
parent 06e0aab31f
commit 0f00140d6c
2 changed files with 7 additions and 6 deletions

View File

@ -452,13 +452,11 @@ minetest.register_on_joinplayer(function(player)
player:get_inventory():set_stack(listname, index, stack)
armor:set_player_armor(player)
armor:update_inventory(player)
pclasses.api.assign_class(player) -- //MFF (Mg|07/18/2015)
end,
on_take = function(inv, listname, index, stack, player)
player:get_inventory():set_stack(listname, index, nil)
armor:set_player_armor(player)
armor:update_inventory(player)
pclasses.api.assign_class(player) -- //MFF (Mg|07/18/2015)
end,
on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
local plaver_inv = player:get_inventory()
@ -467,7 +465,6 @@ minetest.register_on_joinplayer(function(player)
player_inv:set_stack(from_list, from_index, nil)
armor:set_player_armor(player)
armor:update_inventory(player)
pclasses.api.assign_class(player) -- //MFF (Mg|07/18/2015)
end,
allow_put = function(inv, listname, index, stack, player)
--DEBUT modif MFF (crabman/24/06/2015)

View File

@ -120,9 +120,13 @@ function pclasses.api.assign_class(player)
end
end
minetest.register_on_respawnplayer(pclasses.api.assign_class)
minetest.register_on_joinplayer(function(player) minetest.after(1, pclasses.api.assign_class, player) end)
minetest.register_on_leaveplayer(pclasses.api.assign_class)
minetest.register_globalstep(function(dtime)
for id, ref in ipairs(minetest.get_connected_players()) do
pclasses.api.assign_class(ref)
end
end)
-------------------
-- Reserved items