summaryrefslogtreecommitdiffstats
path: root/src/Bindings/PluginLua.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-06-27 20:49:59 +0200
committerMattes D <github@xoft.cz>2016-06-27 20:51:53 +0200
commitbf88312a1664311968736b4ba7ce1458c8b0954e (patch)
tree59bae2de637b5f3c629db8e55fb44a3106266709 /src/Bindings/PluginLua.cpp
parentRemoved dead code related to callbacks. (diff)
downloadcuberite-bf88312a1664311968736b4ba7ce1458c8b0954e.tar
cuberite-bf88312a1664311968736b4ba7ce1458c8b0954e.tar.gz
cuberite-bf88312a1664311968736b4ba7ce1458c8b0954e.tar.bz2
cuberite-bf88312a1664311968736b4ba7ce1458c8b0954e.tar.lz
cuberite-bf88312a1664311968736b4ba7ce1458c8b0954e.tar.xz
cuberite-bf88312a1664311968736b4ba7ce1458c8b0954e.tar.zst
cuberite-bf88312a1664311968736b4ba7ce1458c8b0954e.zip
Diffstat (limited to 'src/Bindings/PluginLua.cpp')
-rw-r--r--src/Bindings/PluginLua.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Bindings/PluginLua.cpp b/src/Bindings/PluginLua.cpp
index 07d0a7526..d1fc2ae4f 100644
--- a/src/Bindings/PluginLua.cpp
+++ b/src/Bindings/PluginLua.cpp
@@ -260,7 +260,7 @@ bool cPluginLua::OnChat(cPlayer & a_Player, AString & a_Message)
}
bool res = false;
auto & hooks = m_HookMap[cPluginManager::HOOK_CHAT];
- for (auto hook: hooks)
+ for (auto & hook: hooks)
{
hook->Call(&a_Player, a_Message, cLuaState::Return, res, a_Message);
if (res)
@@ -1096,9 +1096,9 @@ const char * cPluginLua::GetHookFnName(int a_HookType)
-bool cPluginLua::AddHookCallback(int a_HookType, cLuaState::cCallbackPtr a_Callback)
+bool cPluginLua::AddHookCallback(int a_HookType, cLuaState::cCallbackPtr && a_Callback)
{
- m_HookMap[a_HookType].push_back(a_Callback);
+ m_HookMap[a_HookType].push_back(std::move(a_Callback));
return true;
}