summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2016-11-06 12:05:13 +0100
committerrubenwardy <rubenwardy@gmail.com>2016-11-06 11:05:13 +0000
commit43da09620ed84f13e86b958e52b5c478f01f5227 (patch)
tree239862c3b926881c4f3a9e0bc685a33b0af0dfa6 /init.lua
parentae01ea01dd80ae40a8289e57908586ec70bfa5b6 (diff)
Fix bugs when mod is run outside of Minetest Game (#34)
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua22
1 files changed, 12 insertions, 10 deletions
diff --git a/init.lua b/init.lua
index fa029e3..922b936 100644
--- a/init.lua
+++ b/init.lua
@@ -70,16 +70,18 @@ end
-- This award can't be part of Unified Inventory, it would make a circular dependency
if minetest.get_modpath("unified_inventory") then
- awards.register_achievement("awards_ui_bags", {
- title = S("Backpacker"),
- description = S("Craft 4 large bags."),
- icon = "awards_ui_bags.png",
- trigger = {
- type = "craft",
- item = "unified_inventory:bag_large",
- target = 4
- }
- })
+ if minetest.get_all_craft_recipes("unified_inventory:bag_large") ~= nil then
+ awards.register_achievement("awards_ui_bags", {
+ title = S("Backpacker"),
+ description = S("Craft 4 large bags."),
+ icon = "awards_ui_bags.png",
+ trigger = {
+ type = "craft",
+ item = "unified_inventory:bag_large",
+ target = 4
+ }
+ })
+ end
end
if minetest.get_modpath("fire") then