From 3f4abe8c95e4d37a84018ca4d478a908fca423ac Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Thu, 8 Aug 2013 09:13:13 +0200 Subject: Addeed OnSpawningEntity, OnSpawnedEntity, OnSpawningMonster, OnSpawnedMonster hooks. As requested in FS 418. --- source/LuaState.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source/LuaState.cpp') diff --git a/source/LuaState.cpp b/source/LuaState.cpp index 664ba8147..d4beb249b 100644 --- a/source/LuaState.cpp +++ b/source/LuaState.cpp @@ -396,6 +396,19 @@ void cLuaState::PushObject(cEntity * a_Entity) +void cLuaState::PushObject(cMonster * a_Monster) +{ + ASSERT(IsValid()); + ASSERT(m_NumCurrentFunctionArgs >= 0); // A function must be pushed to stack first + + tolua_pushusertype(m_LuaState, a_Monster, "cMonster"); + m_NumCurrentFunctionArgs += 1; +} + + + + + void cLuaState::PushObject(cItem * a_Item) { ASSERT(IsValid()); -- cgit v1.2.3