mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
fix body:set_gravity_scale & fix docs
This commit is contained in:
parent
e61e8a6147
commit
8b38d57966
4 changed files with 11 additions and 6 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue