fix undeclared global variable bug thanks to @melzua

This commit is contained in:
kaadmy 2015-11-15 08:10:48 -08:00
parent d57b5ed142
commit 8b9e94d61f
1 changed files with 9 additions and 11 deletions

View File

@ -121,20 +121,18 @@ function player_effects.refresh_effects(player)
local phys = {speed = 1, jump = 1, gravity = 1}
for en, _ in pairs(player_effects.effects[player:get_player_name()]) do
if en ~= ename then
local effect = player_effects.get_registered_effect(en)
local effect = player_effects.get_registered_effect(en)
if effect.physics.speed ~= nil then
phys.speed = phys.speed * effect.physics.speed
end
if effect.physics.speed ~= nil then
phys.speed = phys.speed * effect.physics.speed
end
if effect.physics.jump ~= nil then
phys.jump = phys.jump * effect.physics.jump
end
if effect.physics.jump ~= nil then
phys.jump = phys.jump * effect.physics.jump
end
if effect.physics.gravity ~= nil then
phys.gravity = phys.gravity * effect.physics.gravity
end
if effect.physics.gravity ~= nil then
phys.gravity = phys.gravity * effect.physics.gravity
end
end