1
0
Fork 0

Fix several "undeclared global" errors

This commit is contained in:
Wuzzy 2019-02-08 22:44:26 +01:00
parent fb3db5077c
commit a7d429a017
4 changed files with 7 additions and 6 deletions

View File

@ -395,7 +395,7 @@ This function registers a arrow for mobs with the attack type shoot.
(self, player) (self, player)
'hit_mob' a function that is called when the arrow hits a mob; 'hit_mob' a function that is called when the arrow hits a mob;
this function should hurt the mob, the parameters are 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 'hit_node' a function that is called when the arrow hits a node, the
parameters are (self, pos, node) parameters are (self, pos, node)
'tail' when set to 1 adds a trail or tail to mob arrows 'tail' when set to 1 adds a trail or tail to mob arrows

View File

@ -132,7 +132,7 @@ mobs:register_arrow(":mobs_mc:fireball", {
-- direct hit, no fire... just plenty of pain -- direct hit, no fire... just plenty of pain
hit_player = function(self, player) 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, { player:punch(self.object, 1.0, {
full_punch_interval = 0.5, full_punch_interval = 0.5,
damage_groups = {fleshy = 8}, damage_groups = {fleshy = 8},
@ -140,8 +140,8 @@ mobs:register_arrow(":mobs_mc:fireball", {
end, end,
hit_mob = function(self, player) hit_mob = function(self, mob)
minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5,max_hear_distance = 16}) minetest.sound_play("tnt_explode", {pos = mob:get_pos(), gain = 1.5,max_hear_distance = 16})
player:punch(self.object, 1.0, { player:punch(self.object, 1.0, {
full_punch_interval = 0.5, full_punch_interval = 0.5,
damage_groups = {fleshy = 8}, damage_groups = {fleshy = 8},

View File

@ -398,14 +398,13 @@ minetest.register_node("mcl_flowers:waterlily", {
local idef = itemstack:get_definition() local idef = itemstack:get_definition()
if idef.sounds and idef.sounds.place then 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 end
if not minetest.settings:get_bool("creative_mode") then if not minetest.settings:get_bool("creative_mode") then
itemstack:take_item() itemstack:take_item()
end end
else else
minetest.chat_send_player(player_name, "Node is protected")
minetest.record_protection_violation(pos, player_name) minetest.record_protection_violation(pos, player_name)
end end
end end

View File

@ -1,5 +1,7 @@
mcl_spawn = {} mcl_spawn = {}
local mg_name = minetest.get_mapgen_setting("mg_name")
-- Returns current spawn position of player. -- Returns current spawn position of player.
-- If player is nil or not a player, the default spawn point is returned. -- 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, -- The second return value is true if spawn point is player-chosen,