fix:only load lovebird when launched in debug

This commit is contained in:
Kazhnuz 2021-06-06 13:28:09 +02:00
parent 1355b252df
commit 388c6f1ef9

View file

@ -23,7 +23,7 @@
local DebugSystem = Object:extend() local DebugSystem = Object:extend()
local lovebird = require "birb.libs.lovebird" local lovebird
local Levels = enum { local Levels = enum {
"ERROR", "ERROR",
@ -38,12 +38,13 @@ function DebugSystem:new(controller)
self.debugLevel = self.controller.conf.debugLevel or Levels.INFO self.debugLevel = self.controller.conf.debugLevel or Levels.INFO
self.active = (self.debugLevel == Levels.DEBUG) self.active = (self.debugLevel == Levels.DEBUG)
if (self.active) then if (self.active) then
lovebird = require "birb.libs.lovebird"
lovebird.update() lovebird.update()
end end
end end
function DebugSystem:update(dt) function DebugSystem:update(dt)
if (self.active) then if (self.active and lovebird ~= nil) then
lovebird.update(dt) lovebird.update(dt)
end end
end end