use table instead of vector in return type

This commit is contained in:
Cody Glassman 2025-01-16 16:02:59 -08:00
parent 179341b221
commit feeb15d1ff

View File

@ -183,15 +183,15 @@ namespace MWLua
return shader; return shader;
}; };
api["getChain"] = []() { api["getChain"] = [context]() {
std::vector<Shader> chain; sol::table chain(context.sol(), sol::create);
for (const auto& shader : MWBase::Environment::get().getWorld()->getPostProcessor()->getChain()) for (const auto& shader : MWBase::Environment::get().getWorld()->getPostProcessor()->getChain())
{ {
// Don't expose internal shaders to the API, they should be invisible to the user // Don't expose internal shaders to the API, they should be invisible to the user
if (shader->getInternal()) if (shader->getInternal())
continue; continue;
chain.emplace_back(shader); chain.add(Shader(shader));
} }
return chain; return chain;