Update StarLua.cpp
This commit is contained in:
parent
c992d4f72a
commit
fd915ce672
@ -97,6 +97,9 @@ void LuaContext::setRequireFunction(RequireFunction requireFunction) {
|
|||||||
|
|
||||||
void LuaContext::setCallbacks(String const& tableName, LuaCallbacks const& callbacks) const {
|
void LuaContext::setCallbacks(String const& tableName, LuaCallbacks const& callbacks) const {
|
||||||
auto& eng = engine();
|
auto& eng = engine();
|
||||||
|
if (LuaContext::contains(tableName))
|
||||||
|
return;
|
||||||
|
|
||||||
auto callbackTable = eng.createTable();
|
auto callbackTable = eng.createTable();
|
||||||
for (auto const& p : callbacks.callbacks())
|
for (auto const& p : callbacks.callbacks())
|
||||||
callbackTable.set(p.first, eng.createWrappedFunction(p.second));
|
callbackTable.set(p.first, eng.createWrappedFunction(p.second));
|
||||||
|
Loading…
Reference in New Issue
Block a user