Browse Source

[nalc_awards] Ajoute vérification sur la variable joueur

master
sys4 1 year ago
parent
commit
fe3ce296d7
  1. 7
      nalc_awards/init.lua

7
nalc_awards/init.lua

@ -15,6 +15,11 @@
if minetest.get_modpath("awards") then
-- Check if a player object is valid for awards.
local function player_ok(player)
return player and player.is_player and player:is_player() and not player.is_fake_player
end
-- Redéfinition de la description d'awards existant
local award = awards.registered_awards["award_mine3"]
award.description = award.description.." (Unlock the craft of 1 Quarry)"
@ -145,7 +150,7 @@ if minetest.get_modpath("awards") then
-- Customize register_on_craft
minetest.register_on_craft(
function(itemstack, player, old_craft_grid, craft_inv)
if not player or itemstack:is_empty() then
if not player_ok(player) or itemstack:is_empty() then
return
end

Loading…
Cancel
Save