From a7d429a017570a3c55de25360614f6cdc4f1c2d7 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 8 Feb 2019 22:44:26 +0100 Subject: [PATCH] Fix several "undeclared global" errors --- mods/ENTITIES/mcl_mobs/api.txt | 2 +- mods/ENTITIES/mobs_mc/wither.lua | 6 +++--- mods/ITEMS/mcl_flowers/init.lua | 3 +-- mods/PLAYER/mcl_spawn/init.lua | 2 ++ 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api.txt b/mods/ENTITIES/mcl_mobs/api.txt index c09151e9b..157370d0f 100644 --- a/mods/ENTITIES/mcl_mobs/api.txt +++ b/mods/ENTITIES/mcl_mobs/api.txt @@ -395,7 +395,7 @@ This function registers a arrow for mobs with the attack type shoot. (self, player) 'hit_mob' a function that is called when the arrow hits a mob; this function should hurt the mob, the parameters are - (self, player) + (self, mob) 'hit_node' a function that is called when the arrow hits a node, the parameters are (self, pos, node) 'tail' when set to 1 adds a trail or tail to mob arrows diff --git a/mods/ENTITIES/mobs_mc/wither.lua b/mods/ENTITIES/mobs_mc/wither.lua index a52fbdf61..9602d5a54 100644 --- a/mods/ENTITIES/mobs_mc/wither.lua +++ b/mods/ENTITIES/mobs_mc/wither.lua @@ -132,7 +132,7 @@ mobs:register_arrow(":mobs_mc:fireball", { -- direct hit, no fire... just plenty of pain hit_player = function(self, player) - minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 16}) + minetest.sound_play("tnt_explode", {pos = player:get_pos(), gain = 1.5, max_hear_distance = 16}) player:punch(self.object, 1.0, { full_punch_interval = 0.5, damage_groups = {fleshy = 8}, @@ -140,8 +140,8 @@ mobs:register_arrow(":mobs_mc:fireball", { end, - hit_mob = function(self, player) - minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5,max_hear_distance = 16}) + hit_mob = function(self, mob) + minetest.sound_play("tnt_explode", {pos = mob:get_pos(), gain = 1.5,max_hear_distance = 16}) player:punch(self.object, 1.0, { full_punch_interval = 0.5, damage_groups = {fleshy = 8}, diff --git a/mods/ITEMS/mcl_flowers/init.lua b/mods/ITEMS/mcl_flowers/init.lua index 337a5495e..ac575e123 100644 --- a/mods/ITEMS/mcl_flowers/init.lua +++ b/mods/ITEMS/mcl_flowers/init.lua @@ -398,14 +398,13 @@ minetest.register_node("mcl_flowers:waterlily", { local idef = itemstack:get_definition() if idef.sounds and idef.sounds.place then - minetest.sound_play(idef.sounds.place, {pos=above, gain=1}) + minetest.sound_play(idef.sounds.place, {pos=pointed_thing.above, gain=1}) end if not minetest.settings:get_bool("creative_mode") then itemstack:take_item() end else - minetest.chat_send_player(player_name, "Node is protected") minetest.record_protection_violation(pos, player_name) end end diff --git a/mods/PLAYER/mcl_spawn/init.lua b/mods/PLAYER/mcl_spawn/init.lua index 9c9079b9c..d5391f7d2 100644 --- a/mods/PLAYER/mcl_spawn/init.lua +++ b/mods/PLAYER/mcl_spawn/init.lua @@ -1,5 +1,7 @@ mcl_spawn = {} +local mg_name = minetest.get_mapgen_setting("mg_name") + -- Returns current spawn position of player. -- If player is nil or not a player, the default spawn point is returned. -- The second return value is true if spawn point is player-chosen,