diff --git a/NOTES.md b/NOTES.md index f807621..67a01a5 100644 --- a/NOTES.md +++ b/NOTES.md @@ -3,6 +3,7 @@ ### migration to mt 5.0/5.2 There are the issues Tignasse Verte mentionned: Adding `placer` in `register_functions.lua` +(related commit for minenux are commit a996d5ac709446322d6c6261c21e5f0752a6aeeb ) and replacing the two occourances of `nodeupdate` with `minetest.check_for_falling`. Other changes are necessary because I changed (and had to change) quite a lot diff --git a/mods/adventuretest/register_functions.lua b/mods/adventuretest/register_functions.lua index a7109ae..c4de963 100644 --- a/mods/adventuretest/register_functions.lua +++ b/mods/adventuretest/register_functions.lua @@ -98,7 +98,7 @@ minetest.register_on_dignode(adventuretest_dignode) local function adventuretest_placenode(pos, node, placer) hunger.handle_node_actions(pos,node,placer) - if placer:is_player() then + if placer and placer:is_player() then local name = placer:get_player_name() pd.increment(name,STAT_PLACED,1) diff --git a/mods/creative/init.lua b/mods/creative/init.lua index 8e91b2e..59c62f4 100644 --- a/mods/creative/init.lua +++ b/mods/creative/init.lua @@ -144,6 +144,7 @@ if minetest.setting_getbool("creative_mode") then }) minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack) + minetest.log("warning","[creative] maybe missing check for player here?") return true end) diff --git a/mods/hud/itemwheel.lua b/mods/hud/itemwheel.lua index b4b2a54..94d10d0 100644 --- a/mods/hud/itemwheel.lua +++ b/mods/hud/itemwheel.lua @@ -2,8 +2,9 @@ local hb = {} local scale = tonumber(core.setting_get("hud_scaling")) or 1 local function update_wheel(player) + local name = player:get_player_name() - if not player or not name then + if not player or not name or not player:is_player() then return end @@ -169,6 +170,9 @@ minetest.register_on_joinplayer(function(player) end) local function update_wrapper(a, b, player) + if not player or not player:is_player() then + return + end local name = player:get_player_name() if not name then return