fix: search global asset only if there is no local

This commit is contained in:
Kazhnuz 2021-01-23 11:28:40 +01:00
parent e5d8e699bc
commit 92c10440a1

View file

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