diff options
author | chai <chaifix@163.com> | 2019-03-25 23:46:59 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-03-25 23:46:59 +0800 |
commit | 03b3b8ae80559745f98ef94569b421adddeb441f (patch) | |
tree | 7bf46892fef7453d4c25172333bd4fbddb29ee16 /source/3rd-party/Luax/luax_state.inl | |
parent | 82956beb1fe17e1226327638c8ab22b5f5adfc1d (diff) |
*misc
Diffstat (limited to 'source/3rd-party/Luax/luax_state.inl')
-rw-r--r-- | source/3rd-party/Luax/luax_state.inl | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/3rd-party/Luax/luax_state.inl b/source/3rd-party/Luax/luax_state.inl index 4af45a2..20d132c 100644 --- a/source/3rd-party/Luax/luax_state.inl +++ b/source/3rd-party/Luax/luax_state.inl @@ -25,8 +25,7 @@ namespace Luax assert(IsType(-1, LUA_TFUNCTION)); \ Pop(); - _assertmethod(-1, "New"); - //_assertmethod(-1, "__gc"); + //_assertmethod(-1, "New"); #undef _assertmethod @@ -104,6 +103,17 @@ namespace Luax } } + template<typename T> + void LuaxState::SetFieldByIndex(int idx, int key, T value) + { + if (IsTableOrUserdata(idx)) + { + idx = AbsIndex(idx); + this->Push(value); + lua_rawseti(mState, idx, key); + } + } + template<typename T> T LuaxState::GetField(int idx, cc8* key, T value) { |