diff options
Diffstat (limited to 'src/scripting/luautil.cpp')
-rw-r--r-- | src/scripting/luautil.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/scripting/luautil.cpp b/src/scripting/luautil.cpp index 02de6adc..a3602d2a 100644 --- a/src/scripting/luautil.cpp +++ b/src/scripting/luautil.cpp @@ -34,10 +34,21 @@ void raiseScriptError(lua_State *s, const char *format, ...) vsprintf(message, format, args); va_end( args ); - LOG_WARN("Lua script error: "<<message); + LOG_WARN("Lua script error: "<< message); luaL_error(s, message); } +void raiseWarning(lua_State *s, const char *format, ...) +{ + va_list args; + va_start(args, format); + char message[1024]; + vsprintf(message, format, args); + va_end( args ); + + LOG_WARN("Lua script error: "<< message); +} + /* Functions below are unsafe, as they assume the script has passed pointers to objects which have not yet been destroyed. If the script never keeps pointers around, there will be no problem. In order to be safe, the engine |