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)
'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

View file

@ -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},