cLuaState: cMonster descendants don't push their specific type.
The individual mob types aren't exported to Lua, so pushing them would crash the server.
This commit is contained in:
parent
b0a59927fb
commit
d50bbf3899
@ -558,7 +558,16 @@ void cLuaState::Push(cEntity * a_Entity)
|
||||
{
|
||||
ASSERT(IsValid());
|
||||
|
||||
if (a_Entity->IsMob())
|
||||
{
|
||||
// Don't push specific mob types, as those are not exported in the API:
|
||||
tolua_pushusertype(m_LuaState, a_Entity, "cMonster");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Push the specific class type:
|
||||
tolua_pushusertype(m_LuaState, a_Entity, (a_Entity == nullptr) ? "cEntity" : a_Entity->GetClass());
|
||||
}
|
||||
m_NumCurrentFunctionArgs += 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user