fix: missing pack.has_indices if content is not loaded

This commit is contained in:
MihailRis
2025-07-13 15:36:09 +03:00
parent aca9b49c77
commit b02b454573
3 changed files with 40 additions and 11 deletions
+6 -1
View File
@@ -123,8 +123,13 @@ static int l_pack_get_info(
auto runtime = content ? content->getPackRuntime(pack.id) : nullptr;
if (runtime) {
lua::pushboolean(L, runtime->getStats().hasSavingContent());
lua::setfield(L, "has_indices");
} else {
auto stats = pack.loadStats();
lua::pushboolean(
L, stats.has_value() ? stats->hasSavingContent() : false
);
}
lua::setfield(L, "has_indices");
return 1;
}