]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/script/cpp_api/s_base.h
Merge branch 'master' of https://github.com/minetest/minetest
[dragonfireclient.git] / src / script / cpp_api / s_base.h
index e49745f4e8b6ce860cd0720d873dc375b1e81725..19ae8783b263e4471154a1329b6259dbdfe51731 100644 (file)
@@ -128,6 +128,15 @@ class ScriptApiBase : protected LuaHelper {
        friend class ModApiEnvMod;
        friend class LuaVoxelManip;
 
+       /*
+               Subtle edge case with coroutines: If for whatever reason you have a
+               method in a subclass that's called from existing lua_CFunction
+               (any of the l_*.cpp files) then make it static and take the lua_State*
+               as an argument. This is REQUIRED because getStack() will not return the
+               correct state if called inside coroutines.
+
+               Also note that src/script/common/ is the better place for such helpers.
+       */
        lua_State* getStack()
                { return m_luastack; }