Code cleanup
This commit is contained in:
parent
d22805cecd
commit
9dce5581be
|
@ -17,8 +17,6 @@ minetest.register_globalstep(function(dtime)
|
|||
-- Check for invisible players
|
||||
for player, vals in pairs(is_invisible) do
|
||||
|
||||
if is_invisible[player] and player:get_properties() then
|
||||
|
||||
is_invisible[player].timer = is_invisible[player].timer + dtime
|
||||
|
||||
if player:get_pos() then mcl_potions._add_spawner(player, "#B0B0B0") end
|
||||
|
@ -28,17 +26,11 @@ minetest.register_globalstep(function(dtime)
|
|||
is_invisible[player] = nil
|
||||
end
|
||||
|
||||
elseif not player:get_properties() then
|
||||
is_invisible[player] = nil
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- Check for poisoned players
|
||||
for player, vals in pairs(is_poisoned) do
|
||||
|
||||
if is_poisoned[player] and player:get_properties() then
|
||||
|
||||
is_player = player:is_player()
|
||||
entity = player:get_luaentity()
|
||||
|
||||
|
@ -65,17 +57,11 @@ minetest.register_globalstep(function(dtime)
|
|||
is_poisoned[player] = nil
|
||||
end
|
||||
|
||||
elseif not player:get_properties() then
|
||||
is_poisoned[player] = nil
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- Check for regnerating players
|
||||
for player, vals in pairs(is_regenerating) do
|
||||
|
||||
if is_regenerating[player] then
|
||||
|
||||
is_player = player:is_player()
|
||||
entity = player:get_luaentity()
|
||||
|
||||
|
@ -102,16 +88,12 @@ minetest.register_globalstep(function(dtime)
|
|||
is_regenerating[player] = nil
|
||||
end
|
||||
|
||||
elseif not player:get_properties() then
|
||||
is_regenerating[player] = nil
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- Check for water breathing players
|
||||
for player, vals in pairs(is_water_breathing) do
|
||||
|
||||
if is_water_breathing[player] and player:is_player() then
|
||||
if player:is_player() then
|
||||
|
||||
is_water_breathing[player].timer = is_water_breathing[player].timer + dtime
|
||||
|
||||
|
@ -125,7 +107,7 @@ minetest.register_globalstep(function(dtime)
|
|||
is_water_breathing[player] = nil
|
||||
end
|
||||
|
||||
elseif not player:is_player() then
|
||||
else
|
||||
is_water_breathing[player] = nil
|
||||
end
|
||||
|
||||
|
@ -134,9 +116,7 @@ minetest.register_globalstep(function(dtime)
|
|||
-- Check for leaping players
|
||||
for player, vals in pairs(is_leaping) do
|
||||
|
||||
if is_leaping[player] and player:get_properties() then
|
||||
|
||||
player = player or player:get_luaentity()
|
||||
if player:is_player() then
|
||||
|
||||
is_leaping[player].timer = is_leaping[player].timer + dtime
|
||||
|
||||
|
@ -147,7 +127,7 @@ minetest.register_globalstep(function(dtime)
|
|||
is_leaping[player] = nil
|
||||
end
|
||||
|
||||
elseif not player:get_properties() then
|
||||
else
|
||||
is_leaping[player] = nil
|
||||
end
|
||||
|
||||
|
@ -156,9 +136,7 @@ minetest.register_globalstep(function(dtime)
|
|||
-- Check for swift players
|
||||
for player, vals in pairs(is_swift) do
|
||||
|
||||
if is_swift[player] and player:get_properties() then
|
||||
|
||||
player = player or player:get_luaentity()
|
||||
if player:is_player() then
|
||||
|
||||
is_swift[player].timer = is_swift[player].timer + dtime
|
||||
|
||||
|
@ -169,7 +147,7 @@ minetest.register_globalstep(function(dtime)
|
|||
is_swift[player] = nil
|
||||
end
|
||||
|
||||
elseif not player:get_properties() then
|
||||
else
|
||||
is_swift[player] = nil
|
||||
end
|
||||
|
||||
|
@ -178,9 +156,7 @@ minetest.register_globalstep(function(dtime)
|
|||
-- Check for Night Vision equipped players
|
||||
for player, vals in pairs(is_cat) do
|
||||
|
||||
if is_cat[player] and player:get_properties() then
|
||||
|
||||
player = player or player:get_luaentity()
|
||||
if player:is_player() then
|
||||
|
||||
is_cat[player].timer = is_cat[player].timer + dtime
|
||||
|
||||
|
@ -194,7 +170,7 @@ minetest.register_globalstep(function(dtime)
|
|||
is_cat[player] = nil
|
||||
end
|
||||
|
||||
elseif not player:get_properties() then
|
||||
else
|
||||
is_cat[player] = nil
|
||||
end
|
||||
|
||||
|
@ -203,7 +179,7 @@ minetest.register_globalstep(function(dtime)
|
|||
-- Check for Fire Proof players
|
||||
for player, vals in pairs(is_fire_proof) do
|
||||
|
||||
if is_fire_proof[player] and player:get_properties() then
|
||||
if player:is_player() then
|
||||
|
||||
player = player or player:get_luaentity()
|
||||
|
||||
|
@ -215,7 +191,7 @@ minetest.register_globalstep(function(dtime)
|
|||
is_fire_proof[player] = nil
|
||||
end
|
||||
|
||||
elseif not player:get_properties() then
|
||||
else
|
||||
is_fire_proof[player] = nil
|
||||
end
|
||||
|
||||
|
@ -224,9 +200,7 @@ minetest.register_globalstep(function(dtime)
|
|||
-- Check for Weak players
|
||||
for player, vals in pairs(is_weak) do
|
||||
|
||||
if is_weak[player] and player:get_properties() then
|
||||
|
||||
player = player or player:get_luaentity()
|
||||
if player:is_player() then
|
||||
|
||||
is_weak[player].timer = is_weak[player].timer + dtime
|
||||
|
||||
|
@ -236,7 +210,7 @@ minetest.register_globalstep(function(dtime)
|
|||
is_weak[player] = nil
|
||||
end
|
||||
|
||||
elseif not player:get_properties() then
|
||||
else
|
||||
is_weak[player] = nil
|
||||
end
|
||||
|
||||
|
@ -245,9 +219,7 @@ minetest.register_globalstep(function(dtime)
|
|||
-- Check for Strong players
|
||||
for player, vals in pairs(is_strong) do
|
||||
|
||||
if is_strong[player] and player:get_properties() then
|
||||
|
||||
player = player or player:get_luaentity()
|
||||
if player:is_player() then
|
||||
|
||||
is_strong[player].timer = is_strong[player].timer + dtime
|
||||
|
||||
|
@ -257,7 +229,7 @@ minetest.register_globalstep(function(dtime)
|
|||
is_strong[player] = nil
|
||||
end
|
||||
|
||||
elseif not player:get_properties() then
|
||||
else
|
||||
is_strong[player] = nil
|
||||
end
|
||||
|
||||
|
@ -301,8 +273,6 @@ end, true)
|
|||
|
||||
function mcl_potions._reset_player_effects(player)
|
||||
|
||||
player = player or player:get_luaentity()
|
||||
|
||||
if is_invisible[player] then
|
||||
mcl_potions.make_invisible(player, false)
|
||||
is_invisible[player] = nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user