diff --git a/sonic-radiance.love/birb/core/debug.lua b/sonic-radiance.love/birb/core/debug.lua index 372b7f4..ddd423b 100644 --- a/sonic-radiance.love/birb/core/debug.lua +++ b/sonic-radiance.love/birb/core/debug.lua @@ -23,7 +23,7 @@ local DebugSystem = Object:extend() -local lovebird = require "birb.libs.lovebird" +local lovebird local Levels = enum { "ERROR", @@ -38,12 +38,13 @@ function DebugSystem:new(controller) self.debugLevel = self.controller.conf.debugLevel or Levels.INFO self.active = (self.debugLevel == Levels.DEBUG) if (self.active) then + lovebird = require "birb.libs.lovebird" lovebird.update() end end function DebugSystem:update(dt) - if (self.active) then + if (self.active and lovebird ~= nil) then lovebird.update(dt) end end