feat(asset): fail when an asset doesn't exist
This commit is contained in:
parent
b22cc2159f
commit
e5d8e699bc
1 changed files with 9 additions and 2 deletions
|
@ -67,10 +67,17 @@ function AssetManager:clearLocal()
|
||||||
end
|
end
|
||||||
|
|
||||||
function AssetManager:get(name)
|
function AssetManager:get(name)
|
||||||
|
local asset
|
||||||
if self.locals[name] ~= nil then
|
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
|
end
|
||||||
return self.globals[name]
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Specific functions
|
-- Specific functions
|
||||||
|
|
Loading…
Reference in a new issue