[nalc_awards] Ajoute vérification sur la variable joueur
This commit is contained in:
parent
14be3b221a
commit
fe3ce296d7
@ -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…
Reference in New Issue
Block a user