summaryrefslogtreecommitdiffstats
path: root/src/Bindings/ManualBindings.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-05-08 00:18:41 +0200
committerMattes D <github@xoft.cz>2015-05-08 00:18:41 +0200
commit237d8fa501501a8fab881d045fa4f1eee0e728b4 (patch)
treeae916b7f21ea456da862abeee338742d4c7bc6ac /src/Bindings/ManualBindings.cpp
parentMerge pull request #1949 from SafwatHalaby/burn (diff)
parentFixed inter-plugin calls. (diff)
downloadcuberite-237d8fa501501a8fab881d045fa4f1eee0e728b4.tar
cuberite-237d8fa501501a8fab881d045fa4f1eee0e728b4.tar.gz
cuberite-237d8fa501501a8fab881d045fa4f1eee0e728b4.tar.bz2
cuberite-237d8fa501501a8fab881d045fa4f1eee0e728b4.tar.lz
cuberite-237d8fa501501a8fab881d045fa4f1eee0e728b4.tar.xz
cuberite-237d8fa501501a8fab881d045fa4f1eee0e728b4.tar.zst
cuberite-237d8fa501501a8fab881d045fa4f1eee0e728b4.zip
Diffstat (limited to 'src/Bindings/ManualBindings.cpp')
-rw-r--r--src/Bindings/ManualBindings.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index 2fbff11d3..20042a780 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -1988,6 +1988,11 @@ static int tolua_cPluginManager_CallPlugin(lua_State * tolua_S)
{
return 0;
}
+ if (Callback.m_NumReturns < 0)
+ {
+ // The call has failed, there are zero return values. Do NOT return negative number (Lua considers that a "yield")
+ return 0;
+ }
return Callback.m_NumReturns;
}