From 40c98c86b4324c3b1e26f13af5e5360fc86e0e1b Mon Sep 17 00:00:00 2001 From: Elkien3 Date: Tue, 20 Feb 2018 17:15:59 -0600 Subject: [PATCH] patch painting bug --- mods/painting/init.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mods/painting/init.lua b/mods/painting/init.lua index f5641bf..3a75a3c 100644 --- a/mods/painting/init.lua +++ b/mods/painting/init.lua @@ -252,10 +252,14 @@ local function draw_input(self, name, x,y, as_line) local y0 = self.y0 local line = vector.twoline(x0-x, y0-y) -- This figures how to do the line. for _,coord in pairs(line) do - self.grid[x+coord[1]][y+coord[2]] = colors[name] + if self.grid then + self.grid[x+coord[1]][y+coord[2]] = colors[name] + end end else -- Draw just single point. - self.grid[x][y] = colors[name] + if self.grid then + self.grid[x][y] = colors[name] + end end self.x0, self.y0 = x, y -- Update previous position. -- Actually update the grid.