feat(asset): fail when an asset doesn't exist

This commit is contained in:
Kazhnuz Klappsthul 2021-01-17 12:44:40 +01:00
parent b22cc2159f
commit e5d8e699bc
1 changed files with 9 additions and 2 deletions

View File

@ -67,10 +67,17 @@ function AssetManager:clearLocal()
end
function AssetManager:get(name)
local asset
if self.locals[name] ~= nil then
return self.locals[name]
asset = self.locals[name]
end
asset = self.globals[name]
if (asset ~= nil) then
return asset
else
core.debug:fail("birb.modules.assets", "L'asset " .. name .. " n'existe pas.")
end
return self.globals[name]
end
-- Specific functions