Submitted by Jean-Michel Masereel <jean-michel.masereel@laposte.net>
Date : 2013-05-10                                                                                                      
Description : fix crash of the application during execution. (luaopen_module not call correctly) 
--- fillets-ng-1.0.1/src/gengine/ScriptState.cpp	2014-05-09 01:21:23.144761023 +0200
+++ fillets-ng-1.0.1/src/gengine/ScriptState.cpp	2014-05-09 02:05:04.695844913 +0200
@@ -27,10 +27,12 @@
 ScriptState::ScriptState()
 {
     m_state = lua_open();
-    luaopen_base(m_state);
-    luaopen_string(m_state);
-    luaopen_math(m_state);
-    luaopen_table(m_state);
+    luaL_requiref(m_state, "_G", luaopen_base, 1);
+    luaL_requiref(m_state, LUA_STRLIBNAME, luaopen_string, 1);
+    luaL_requiref(m_state, LUA_MATHLIBNAME, luaopen_math, 1);
+    luaL_requiref(m_state, LUA_TABLIBNAME, luaopen_table, 1);
+
+  lua_pop(m_state, 4);
 
     prepareErrorHandler();
 }
