MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / lua_rotate

Function lua_rotate

Libs/sol/sol.hpp:3646–3659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3644}
3645
3646COMPAT53_API void lua_rotate(lua_State* L, int idx, int n) {
3647 int n_elems = 0;
3648 idx = lua_absindex(L, idx);
3649 n_elems = lua_gettop(L) - idx + 1;
3650 if (n < 0)
3651 n += n_elems;
3652 if (n > 0 && n < n_elems) {
3653 luaL_checkstack(L, 2, "not enough stack slots available");
3654 n = n_elems - n;
3655 compat53_reverse(L, idx, idx + n - 1);
3656 compat53_reverse(L, idx + n, idx + n_elems - 1);
3657 compat53_reverse(L, idx, idx + n_elems - 1);
3658 }
3659}
3660
3661COMPAT53_API void lua_seti(lua_State* L, int index, lua_Integer i) {
3662 luaL_checkstack(L, 1, "not enough stack slots available");

Callers 1

script_throw_on_errorFunction · 0.85

Calls 3

lua_absindexFunction · 0.85
luaL_checkstackFunction · 0.85
compat53_reverseFunction · 0.85

Tested by

no test coverage detected