From 50410958f0016d8b47d4ee77956e4f711e9227c6 Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj Date: Sun, 16 Jul 2023 01:54:20 -0400 Subject: [PATCH] Re-add clamp for backgrounds beyond the limit --- load/graphics.lua | 2 +- tetris/modes/gamemode.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/load/graphics.lua b/load/graphics.lua index 6fb160e..b2f3e12 100644 --- a/load/graphics.lua +++ b/load/graphics.lua @@ -8,7 +8,7 @@ image_formats = {".png", ".jpg"} bgpath = "res/backgrounds/" dir = love.filesystem.getDirectoryItems(bgpath) -local backgrounds = {} +backgrounds = {} local function loadExtendedBgs() extended_bgs = require("res.backgrounds.extend_section_bg") diff --git a/tetris/modes/gamemode.lua b/tetris/modes/gamemode.lua index 9123e59..980f00f 100644 --- a/tetris/modes/gamemode.lua +++ b/tetris/modes/gamemode.lua @@ -980,7 +980,7 @@ end function GameMode:drawBackground() local id = self:getBackground() - -- if type(id) == "number" then id = clamp(id, 0, #backgrounds) end + if type(id) == "number" then id = clamp(id, 0, #backgrounds) end love.graphics.setColor(1, 1, 1, 1) drawBackground(id) end