Small fix

This commit is contained in:
Federico Cecchetto 2022-03-03 01:17:22 +01:00
parent 4ca10438eb
commit 82a79009a3

View File

@ -48,16 +48,6 @@ namespace scripting::lua
state["level"] = entity{*::game::levelEntityId};
state["player"] = call("getentbynum", {0}).as<entity>();
state["io"]["fileexists"] = utils::io::file_exists;
state["io"]["writefile"] = utils::io::write_file;
state["io"]["filesize"] = utils::io::file_size;
state["io"]["createdirectory"] = utils::io::create_directory;
state["io"]["directoryexists"] = utils::io::directory_exists;
state["io"]["directoryisempty"] = utils::io::directory_is_empty;
state["io"]["listfiles"] = utils::io::list_files;
state["io"]["copyfolder"] = utils::io::copy_folder;
state["io"]["readfile"] = static_cast<std::string(*)(const std::string&)>(utils::io::read_file);
auto vector_type = state.new_usertype<vector>("vector", sol::constructors<vector(float, float, float)>());
vector_type["x"] = sol::property(&vector::get_x, &vector::set_x);
vector_type["y"] = sol::property(&vector::get_y, &vector::set_y);
@ -198,8 +188,8 @@ namespace scripting::lua
void setup_entity_type(sol::state& state, event_handler& handler, scheduler& scheduler)
{
state["level"] = entity{ *::game::levelEntityId };
state["player"] = call("getentbynum", { 0 }).as<entity>();
state["level"] = entity{*::game::levelEntityId};
state["player"] = call("getentbynum", {0}).as<entity>();
auto entity_type = state.new_usertype<entity>("entity");