mirror of
https://github.com/minetest-mods/armor_monoid.git
synced 2024-11-13 06:00:21 +01:00
compatibilit with minetest 0.4.17 and 5.0.0 for player object bug
* minetest/minetest#8452
This commit is contained in:
parent
c5c43514f4
commit
8091b1ebc0
12
init.lua
12
init.lua
|
@ -73,21 +73,27 @@ armor_monoid.monoid = player_monoids.make_monoid({
|
|||
|
||||
join_handled[player:get_player_name()] = true
|
||||
|
||||
player:set_armor_groups(final)
|
||||
if player then
|
||||
player:set_armor_groups(final)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- If the monoid has not fired yet (or won't fire)
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
if not join_handled[player:get_player_name()] then
|
||||
player:set_armor_groups(armor_groups)
|
||||
if player then
|
||||
if not join_handled[player:get_player_name()] then
|
||||
player:set_armor_groups(armor_groups)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
if player then
|
||||
join_handled[player:get_player_name()] = nil
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user