1
0

Made pushing plain pointer to Lua a valid operation, with a warning.

This is used for exotic explosions, and the NORETURNDEBUG macro caused MSVC warnings across the entire cLuaState class (MSVC marked ALL Push() function overloads as non-returning)
This commit is contained in:
madmaxoft 2014-03-20 09:16:47 +01:00
parent fe6c03595f
commit 964647a900
2 changed files with 4 additions and 3 deletions

View File

@ -689,9 +689,10 @@ void cLuaState::Push(void * a_Ptr)
ASSERT(IsValid());
// Investigate the cause of this - what is the callstack?
LOGWARNING("Lua engine encountered an error - attempting to push a plain pointer");
// One code path leading here is the OnHookExploding / OnHookExploded with exotic parameters. Need to decide what to do with them
LOGWARNING("Lua engine: attempting to push a plain pointer, pushing nil instead.");
LOGWARNING("This indicates an unimplemented part of MCS bindings");
LogStackTrace();
ASSERT(!"A plain pointer should never be pushed on Lua stack");
lua_pushnil(m_LuaState);
m_NumCurrentFunctionArgs += 1;

View File

@ -200,7 +200,7 @@ public:
void Push(const HTTPTemplateRequest * a_Request);
void Push(cTNTEntity * a_TNTEntity);
void Push(Vector3i * a_Vector);
NORETURNDEBUG void Push(void * a_Ptr);
void Push(void * a_Ptr);
void Push(cHopperEntity * a_Hopper);
void Push(cBlockEntity * a_BlockEntity);