From 42e68755479b62d37f4460db8f4d0d274b911d11 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 28 Dec 2019 16:54:13 +0100 Subject: [PATCH] fix: make sure that some variable doesn't leak to the global namespace --- sonic-bluestreak.love/game/modules/world/actors/parent.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sonic-bluestreak.love/game/modules/world/actors/parent.lua b/sonic-bluestreak.love/game/modules/world/actors/parent.lua index 951c67c..ee81b78 100644 --- a/sonic-bluestreak.love/game/modules/world/actors/parent.lua +++ b/sonic-bluestreak.love/game/modules/world/actors/parent.lua @@ -7,7 +7,7 @@ function Parent:new(world, type, x, y, z, w, h, d, isSolid) end function Parent:draw() - drawx, drawy, drawz = self.x, self.y, self.z + local drawx, drawy, drawz = self.x, self.y, self.z if (self.world.maptype == "shoot") then drawx = drawx + math.floor(drawy/2) end @@ -22,6 +22,8 @@ function Parent:draw() end function Parent:drawShadow(x, y) + local x = x or 0 + local y = y or 0 if (self.world.maptype == "shoot") then x = x + math.floor(y/2) end