mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-21 18:09:46 +00:00
feat: variant-based hitboxes
This commit is contained in:
parent
563001351b
commit
b8b2e4f451
16 changed files with 145 additions and 102 deletions
|
|
@ -468,7 +468,10 @@ static int l_get_hitbox(lua::State* L) {
|
|||
} else {
|
||||
rotation = 0;
|
||||
}
|
||||
auto& hitbox = def->rt.hitboxes[rotation].at(hitboxIndex);
|
||||
const auto& variant =
|
||||
def->variants ? def->variants->variants[get_variant_index(L, *def, 4)]
|
||||
: def->defaults;
|
||||
auto& hitbox = variant.rt.hitboxes[rotation].at(hitboxIndex);
|
||||
lua::createtable(L, 2, 0);
|
||||
|
||||
lua::pushvec3(L, hitbox.min());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue