Merge branch 'github'

This commit is contained in:
bri cassa 2022-06-26 12:26:43 +02:00
commit 0f912aca2c
4 changed files with 12 additions and 6 deletions

View File

@ -1 +0,0 @@
player_monoids

View File

@ -1 +0,0 @@
A player_monoids monoid for armor

View File

@ -73,21 +73,27 @@ armor_monoid.monoid = player_monoids.make_monoid({
join_handled[player:get_player_name()] = true join_handled[player:get_player_name()] = true
player:set_armor_groups(final) if player then
player:set_armor_groups(final)
end
end, end,
}) })
-- If the monoid has not fired yet (or won't fire) -- If the monoid has not fired yet (or won't fire)
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
if not join_handled[player:get_player_name()] then if player then
player:set_armor_groups(armor_groups) if not join_handled[player:get_player_name()] then
player:set_armor_groups(armor_groups)
end
end end
end) end)
minetest.register_on_leaveplayer(function(player) minetest.register_on_leaveplayer(function(player)
if player then
join_handled[player:get_player_name()] = nil join_handled[player:get_player_name()] = nil
end
end) end)

View File

@ -1 +1,3 @@
name=armor_monoid name=armor_monoid
description = A player_monoids monoid for armor
depends = player_monoids