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:
parent
fe6c03595f
commit
964647a900
@ -689,9 +689,10 @@ void cLuaState::Push(void * a_Ptr)
|
|||||||
ASSERT(IsValid());
|
ASSERT(IsValid());
|
||||||
|
|
||||||
// Investigate the cause of this - what is the callstack?
|
// 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();
|
LogStackTrace();
|
||||||
ASSERT(!"A plain pointer should never be pushed on Lua stack");
|
|
||||||
|
|
||||||
lua_pushnil(m_LuaState);
|
lua_pushnil(m_LuaState);
|
||||||
m_NumCurrentFunctionArgs += 1;
|
m_NumCurrentFunctionArgs += 1;
|
||||||
|
@ -200,7 +200,7 @@ public:
|
|||||||
void Push(const HTTPTemplateRequest * a_Request);
|
void Push(const HTTPTemplateRequest * a_Request);
|
||||||
void Push(cTNTEntity * a_TNTEntity);
|
void Push(cTNTEntity * a_TNTEntity);
|
||||||
void Push(Vector3i * a_Vector);
|
void Push(Vector3i * a_Vector);
|
||||||
NORETURNDEBUG void Push(void * a_Ptr);
|
void Push(void * a_Ptr);
|
||||||
void Push(cHopperEntity * a_Hopper);
|
void Push(cHopperEntity * a_Hopper);
|
||||||
void Push(cBlockEntity * a_BlockEntity);
|
void Push(cBlockEntity * a_BlockEntity);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user