Merge branch 'main' into dev
This commit is contained in:
@@ -54,7 +54,12 @@ static int l_get_gravity_scale(lua::State* L) {
|
||||
|
||||
static int l_set_gravity_scale(lua::State* L) {
|
||||
if (auto entity = get_entity(L, 1)) {
|
||||
entity->getRigidbody().hitbox.gravityScale = lua::tovec3(L, 2).y;
|
||||
auto& hitbox = entity->getRigidbody().hitbox;
|
||||
if (lua::istable(L, 2)) {
|
||||
hitbox.gravityScale = lua::tovec3(L, 2).y;
|
||||
} else {
|
||||
hitbox.gravityScale = lua::tonumber(L, 2);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#include <algorithm>
|
||||
#include <filesystem>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <set>
|
||||
#define VC_ENABLE_REFLECTION
|
||||
|
||||
#include "assets/AssetsLoader.hpp"
|
||||
#include "content/Content.hpp"
|
||||
@@ -19,6 +15,12 @@
|
||||
#include "world/World.hpp"
|
||||
#include "api_lua.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <filesystem>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <set>
|
||||
|
||||
using namespace scripting;
|
||||
|
||||
static int l_pack_get_folder(lua::State* L) {
|
||||
@@ -114,8 +116,16 @@ static int l_pack_get_info(
|
||||
default:
|
||||
throw std::runtime_error("");
|
||||
}
|
||||
auto opString = VersionOperatorMeta.getNameString(dpack.op);
|
||||
|
||||
lua::pushfstring(L, "%s%s@%s%s", prefix.c_str(), dpack.id.c_str(), dpack.op.c_str(), dpack.version.c_str());
|
||||
lua::pushfstring(
|
||||
L,
|
||||
"%s%s@%s%s",
|
||||
prefix.c_str(),
|
||||
dpack.id.c_str(),
|
||||
(dpack.op == VersionOperator::EQUAL ? "" : opString).c_str(),
|
||||
dpack.version.c_str()
|
||||
);
|
||||
lua::rawseti(L, i + 1);
|
||||
}
|
||||
lua::setfield(L, "dependencies");
|
||||
|
||||
Reference in New Issue
Block a user