mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Implemented gameobjects and creatures grouping (pools of them)
Groups (called pools) can be also member of any game event Signed-off-by: Neo2003 <neo.2003@hotmail.fr> Signed-off-by: freghar <compmancz@gmail.com>
This commit is contained in:
parent
1932ce1ae7
commit
7d8dc0eeef
14 changed files with 879 additions and 39 deletions
|
|
@ -20,6 +20,7 @@
|
|||
#include "QuestDef.h"
|
||||
#include "GameObject.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "PoolHandler.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "Spell.h"
|
||||
#include "UpdateMask.h"
|
||||
|
|
@ -62,7 +63,7 @@ GameObject::~GameObject()
|
|||
{
|
||||
if(m_uint32Values) // field array can be not exist if GameOBject not loaded
|
||||
{
|
||||
// crash possible at access to deleted GO in Unit::m_gameobj
|
||||
// Possible crash at access to deleted GO in Unit::m_gameobj
|
||||
uint64 owner_guid = GetOwnerGUID();
|
||||
if(owner_guid)
|
||||
{
|
||||
|
|
@ -275,7 +276,11 @@ void GameObject::Update(uint32 /*p_time*/)
|
|||
return;
|
||||
}
|
||||
// respawn timer
|
||||
GetMap()->Add(this);
|
||||
uint16 poolid = poolhandler.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT);
|
||||
if (poolid)
|
||||
poolhandler.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT);
|
||||
else
|
||||
GetMap()->Add(this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -477,7 +482,11 @@ void GameObject::Delete()
|
|||
SetGoState(1);
|
||||
SetUInt32Value(GAMEOBJECT_FLAGS, GetGOInfo()->flags);
|
||||
|
||||
AddObjectToRemoveList();
|
||||
uint16 poolid = poolhandler.IsPartOfAPool(GetGUIDLow(), TYPEID_GAMEOBJECT);
|
||||
if (poolid)
|
||||
poolhandler.UpdatePool(poolid, GetGUIDLow(), TYPEID_GAMEOBJECT);
|
||||
else
|
||||
AddObjectToRemoveList();
|
||||
}
|
||||
|
||||
void GameObject::getFishLoot(Loot *fishloot, Player* loot_owner)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue