mirror of https://gitlab.com/rubenwardy/awards.git
Fix rebase and remove things already fixed earlier.
This commit is contained in:
parent
0ef385c514
commit
0790e8feeb
|
@ -43,7 +43,8 @@ end
|
|||
-- name - the name of the player
|
||||
-- award - the name of the award to give
|
||||
function awards.unlock(name, award)
|
||||
if not minetest.get_player_by_name(name) or not minetest.get_player_by_name(name):is_player() then
|
||||
-- Ensure the player is online.
|
||||
if not minetest.get_player_by_name(name) then
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -95,7 +96,7 @@ function awards.unlock(name, award)
|
|||
local title = awdef.title or award
|
||||
local desc = awdef.description or ""
|
||||
local background = awdef.background or "awards_bg_default.png"
|
||||
local icon = awdef.icon.."^[resize:16x16" or "awards_unknown.png"
|
||||
local icon = (awdef.icon or "awards_unknown.png") .. "^[resize:32x32"
|
||||
local sound = awdef.sound
|
||||
if sound == nil then
|
||||
-- Explicit check for nil because sound could be `false` to disable it
|
||||
|
|
|
@ -62,9 +62,6 @@ function awards.register_trigger(tname, tdef)
|
|||
end
|
||||
|
||||
function tdef.notify(player)
|
||||
if not player:is_player() or not minetest.get_player_by_name(player:get_player_name()) then
|
||||
return
|
||||
end
|
||||
assert(player and player.is_player and player:is_player())
|
||||
local name = player:get_player_name()
|
||||
local data = awards.player(name)
|
||||
|
@ -155,10 +152,6 @@ function awards.register_trigger(tname, tdef)
|
|||
end
|
||||
end
|
||||
|
||||
if not player:is_player() or not minetest.get_player_by_name(player:get_player_name()) then
|
||||
return
|
||||
end
|
||||
|
||||
assert(player and player.is_player and player:is_player() and key)
|
||||
local name = player:get_player_name()
|
||||
local data = awards.player(name)
|
||||
|
|
|
@ -120,7 +120,7 @@ minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv
|
|||
|
||||
local itemname = itemstack:get_name()
|
||||
itemname = minetest.registered_aliases[itemname] or itemname
|
||||
awards.notify_eat(player, itemname)
|
||||
awards.notify_craft(player, itemname, itemstack:get_count())
|
||||
end)
|
||||
|
||||
|
||||
|
@ -141,5 +141,5 @@ minetest.register_on_item_eat(function(_, _, itemstack, player, _)
|
|||
|
||||
local itemname = itemstack:get_name()
|
||||
itemname = minetest.registered_aliases[itemname] or itemname
|
||||
awards.notify_eat(player, itemname, itemstack:get_count())
|
||||
awards.notify_eat(player, itemname)
|
||||
end)
|
||||
|
|
Loading…
Reference in New Issue