diff --git a/depends.txt b/depends.txt deleted file mode 100644 index 61bc671..0000000 --- a/depends.txt +++ /dev/null @@ -1 +0,0 @@ -player_monoids diff --git a/description.txt b/description.txt deleted file mode 100644 index d0eee6f..0000000 --- a/description.txt +++ /dev/null @@ -1 +0,0 @@ -A player_monoids monoid for armor diff --git a/init.lua b/init.lua index f1765ae..9e0b385 100644 --- a/init.lua +++ b/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) diff --git a/mod.conf b/mod.conf index a0aa1d2..9bd8fea 100644 --- a/mod.conf +++ b/mod.conf @@ -1 +1,3 @@ -name=armor_monoid \ No newline at end of file +name=armor_monoid +description = A player_monoids monoid for armor +depends = player_monoids