Closed programmerjake closed 2 days ago
Having the same issue, fixed the error by simply adding
if awards then awards.unlock(player_name, "researcher:eureka") end
in gui.lua
Tested with and without the awards mod, and the award is given when the award mod is enabled, and no crash when it's not.
Thanks for reporting this issue. I usually try to catch cases like this but I must have missed this condition. The Awards mod is meant to be optional and the fix you've described is exactly what Researcher needs. I'll get this change merged very soon.
if awards then awards.unlock(player_name, "researcher:eureka") end
note you'll want to use core.global_exists("awards")
instead of just awards
to avoid triggering a warning on accessing a non-existent global
Actually, checking if researcher.settings.awards then ...
is the most thorough check as it ensures that awards are enabled in the settings and also checks that the modpath is defined which indicates that the Awards mod is loaded. I already have this check in api.lua for other award unlocks, I just missed it here. I'm cooking up a quick little PR to add the check.
Done! Thanks again for reporting this issue! I'll also get this released to ContentDB.
Reproduction steps: create new minetest game world with researcher but without awards try to research a stack of items observe it crashing: