diff --git a/src/scripting/lua_kernel_base.cpp b/src/scripting/lua_kernel_base.cpp index e47f70ab19d8..2400d28cbced 100644 --- a/src/scripting/lua_kernel_base.cpp +++ b/src/scripting/lua_kernel_base.cpp @@ -655,6 +655,10 @@ lua_kernel_base::lua_kernel_base(CVideo * video) // Override the print function cmd_log_ << "Redirecting print function...\n"; + lua_getglobal(L, "print"); + lua_setglobal(L, "std_print"); //storing original impl as 'std_print' + lua_settop(L, 0); //clear stack, just to be sure + lua_cfunc my_print = boost::bind(&lua_kernel_base::intf_print, this, _1); push_boost_cfunc(L, my_print); lua_setglobal(L, "print");