feat: variant-based hitboxes

This commit is contained in:
MihailRis 2026-10-31 17:15:16 +03:00
parent 563001351b
commit b8b2e4f451
16 changed files with 145 additions and 102 deletions

View file

@ -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());