add 'player-entity' to defaults.toml

This commit is contained in:
MihailRis
2025-02-12 16:32:21 +03:00
parent f0c7bc6377
commit 3430e5cd6f
10 changed files with 34 additions and 11 deletions
@@ -6,6 +6,7 @@
#include "world/Level.hpp"
#include "world/generator/VoxelFragment.hpp"
#include "content/ContentLoader.hpp"
#include "content/Content.hpp"
#include "engine/Engine.hpp"
#include "../lua_custom_types.hpp"
@@ -69,8 +70,9 @@ static int l_get_generators(lua::State* L) {
/// @brief Get the default world generator
/// @return The ID of the default world generator
static int l_get_default_generator(lua::State* L) {
// content is not initialized yet
auto combined = engine->getResPaths()->readCombinedObject(
EnginePaths::CONFIG_DEFAULTS.u8string()
EnginePaths::CONFIG_DEFAULTS.string()
);
return lua::pushstring(L, combined["generator"].asString());
}
@@ -81,4 +83,5 @@ const luaL_Reg generationlib[] = {
{"load_fragment", lua::wrap<l_load_fragment>},
{"get_generators", lua::wrap<l_get_generators>},
{"get_default_generator", lua::wrap<l_get_default_generator>},
{NULL, NULL}};
{NULL, NULL}
};