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/Entity.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source/Entity.cpp') diff --git a/source/Entity.cpp b/source/Entity.cpp index 2c822d0cc..8afdfdb95 100644 --- a/source/Entity.cpp +++ b/source/Entity.cpp @@ -129,14 +129,22 @@ const char * cEntity::GetParentClass(void) const -void cEntity::Initialize(cWorld * a_World) +bool cEntity::Initialize(cWorld * a_World) { + if (cPluginManager::Get()->CallHookSpawningEntity(*a_World, *this)) + { + return false; + } + LOGD("Initializing entity #%d (%s) at {%.02f, %.02f, %.02f}", m_UniqueID, GetClass(), m_Pos.x, m_Pos.y, m_Pos.z ); m_IsInitialized = true; m_World = a_World; m_World->AddEntity(this); + + cPluginManager::Get()->CallHookSpawnedEntity(*a_World, *this); + return true; } -- cgit v1.2.3