Browse Source

[nalc_awards] Ajoute vérification sur la variable joueur

tags/nalc-1.2.0
sys4 1 month ago
parent
commit
fe3ce296d7
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      nalc_awards/init.lua

+ 6
- 1
nalc_awards/init.lua View File

@@ -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