diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2016-10-04 11:02:31 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2016-10-04 11:02:31 +0100 |
commit | 47abff26aed78b606aad72c79ec027269a7fc15f (patch) | |
tree | 1459441e5250c047562b2563871c10622826a464 | |
parent | 444b486c5e83ff9166fa8cf4c8e1847c8c581b72 (diff) |
make invisibility player table global (mobs.invis[playername])
-rw-r--r-- | api.lua | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -27,9 +27,9 @@ end mobs.intllib = S -- Invisibility mod check -local invis = {} +mobs.invis = {} if rawget(_G, "invisibility") then - invis = invisibility + mobs.invis = invisibility end -- Load settings @@ -617,7 +617,7 @@ end -- should mob follow what I'm holding ? function follow_holding(self, clicker) - if invis[clicker:get_player_name()] then + if mobs.invis[clicker:get_player_name()] then return false end @@ -1017,7 +1017,7 @@ local monster_attack = function(self) if objs[n]:is_player() then - if invis[ objs[n]:get_player_name() ] then + if mobs.invis[ objs[n]:get_player_name() ] then type = "" else @@ -1122,7 +1122,7 @@ local follow_flop = function(self) for n = 1, #players do if get_distance(players[n]:getpos(), s) < self.view_range - and not invis[ players[n]:get_player_name() ] then + and not mobs.invis[ players[n]:get_player_name() ] then self.following = players[n] @@ -1425,7 +1425,7 @@ local do_states = function(self, dtime) or not self.attack or not self.attack:getpos() or self.attack:get_hp() <= 0 - or (self.attack:is_player() and invis[ self.attack:get_player_name() ]) then + or (self.attack:is_player() and mobs.invis[ self.attack:get_player_name() ]) then --print(" ** stop attacking **", dist, self.view_range) self.state = "stand" @@ -2004,7 +2004,7 @@ local mob_punch = function(self, hitter, tflp, tool_capabilities, dir) and self.state ~= "flop" and self.child == false and hitter:get_player_name() ~= self.owner - and not invis[ hitter:get_player_name() ] then + and not mobs.invis[ hitter:get_player_name() ] then -- attack whoever punched mob self.state = "" |