mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2024-11-22 12:43:42 +01:00
Run inventory equip callbacks before set_player_armor
This commit is contained in:
parent
7566ecccee
commit
df429ee487
@ -179,13 +179,13 @@ armor.init_player_armor = function(self, player)
|
||||
local armor_inv = minetest.create_detached_inventory(name.."_armor", {
|
||||
on_put = function(inv, listname, index, stack, player)
|
||||
player:get_inventory():set_stack(listname, index, stack)
|
||||
armor:set_player_armor(player)
|
||||
armor:run_callbacks("on_equip", player, index, stack)
|
||||
armor:set_player_armor(player)
|
||||
end,
|
||||
on_take = function(inv, listname, index, stack, player)
|
||||
player:get_inventory():set_stack(listname, index, nil)
|
||||
armor:set_player_armor(player)
|
||||
armor:run_callbacks("on_unequip", player, index, stack)
|
||||
armor:set_player_armor(player)
|
||||
end,
|
||||
on_move = function(inv, from_list, from_index, to_list, to_index, count, player)
|
||||
local plaver_inv = player:get_inventory()
|
||||
|
Loading…
Reference in New Issue
Block a user