mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[7657] Implement function for access to gameobject owned by unit and created by some spell.
This commit is contained in:
parent
6438bf557f
commit
0e1997f746
3 changed files with 21 additions and 7 deletions
|
|
@ -2916,7 +2916,7 @@ void Unit::_UpdateSpells( uint32 time )
|
||||||
|
|
||||||
if(!m_gameObj.empty())
|
if(!m_gameObj.empty())
|
||||||
{
|
{
|
||||||
std::list<GameObject*>::iterator ite1, dnext1;
|
GameObjectList::iterator ite1, dnext1;
|
||||||
for (ite1 = m_gameObj.begin(); ite1 != m_gameObj.end(); ite1 = dnext1)
|
for (ite1 = m_gameObj.begin(); ite1 != m_gameObj.end(); ite1 = dnext1)
|
||||||
{
|
{
|
||||||
dnext1 = ite1;
|
dnext1 = ite1;
|
||||||
|
|
@ -4059,6 +4059,15 @@ DynamicObject * Unit::GetDynObject(uint32 spellId)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GameObject* Unit::GetGameObject(uint32 spellId) const
|
||||||
|
{
|
||||||
|
for (GameObjectList::const_iterator i = m_gameObj.begin(); i != m_gameObj.end();)
|
||||||
|
if ((*i)->GetSpellId() == spellId)
|
||||||
|
return *i;
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
void Unit::AddGameObject(GameObject* gameObj)
|
void Unit::AddGameObject(GameObject* gameObj)
|
||||||
{
|
{
|
||||||
assert(gameObj && gameObj->GetOwnerGUID()==0);
|
assert(gameObj && gameObj->GetOwnerGUID()==0);
|
||||||
|
|
@ -4109,7 +4118,7 @@ void Unit::RemoveGameObject(uint32 spellid, bool del)
|
||||||
{
|
{
|
||||||
if(m_gameObj.empty())
|
if(m_gameObj.empty())
|
||||||
return;
|
return;
|
||||||
std::list<GameObject*>::iterator i, next;
|
GameObjectList::iterator i, next;
|
||||||
for (i = m_gameObj.begin(); i != m_gameObj.end(); i = next)
|
for (i = m_gameObj.begin(); i != m_gameObj.end(); i = next)
|
||||||
{
|
{
|
||||||
next = i;
|
next = i;
|
||||||
|
|
@ -4132,7 +4141,7 @@ void Unit::RemoveGameObject(uint32 spellid, bool del)
|
||||||
void Unit::RemoveAllGameObjects()
|
void Unit::RemoveAllGameObjects()
|
||||||
{
|
{
|
||||||
// remove references to unit
|
// remove references to unit
|
||||||
for(std::list<GameObject*>::iterator i = m_gameObj.begin(); i != m_gameObj.end();)
|
for(GameObjectList::iterator i = m_gameObj.begin(); i != m_gameObj.end();)
|
||||||
{
|
{
|
||||||
(*i)->SetOwnerGUID(0);
|
(*i)->SetOwnerGUID(0);
|
||||||
(*i)->SetRespawnTime(0);
|
(*i)->SetRespawnTime(0);
|
||||||
|
|
|
||||||
|
|
@ -1320,16 +1320,20 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
||||||
void SetNativeDisplayId(uint32 modelId) { SetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID, modelId); }
|
void SetNativeDisplayId(uint32 modelId) { SetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID, modelId); }
|
||||||
void setTransForm(uint32 spellid) { m_transform = spellid;}
|
void setTransForm(uint32 spellid) { m_transform = spellid;}
|
||||||
uint32 getTransForm() const { return m_transform;}
|
uint32 getTransForm() const { return m_transform;}
|
||||||
|
|
||||||
|
DynamicObject* GetDynObject(uint32 spellId, uint32 effIndex);
|
||||||
|
DynamicObject* GetDynObject(uint32 spellId);
|
||||||
void AddDynObject(DynamicObject* dynObj);
|
void AddDynObject(DynamicObject* dynObj);
|
||||||
void RemoveDynObject(uint32 spellid);
|
void RemoveDynObject(uint32 spellid);
|
||||||
void RemoveDynObjectWithGUID(uint64 guid) { m_dynObjGUIDs.remove(guid); }
|
void RemoveDynObjectWithGUID(uint64 guid) { m_dynObjGUIDs.remove(guid); }
|
||||||
void RemoveAllDynObjects();
|
void RemoveAllDynObjects();
|
||||||
|
|
||||||
|
GameObject* GetGameObject(uint32 spellId) const;
|
||||||
void AddGameObject(GameObject* gameObj);
|
void AddGameObject(GameObject* gameObj);
|
||||||
void RemoveGameObject(GameObject* gameObj, bool del);
|
void RemoveGameObject(GameObject* gameObj, bool del);
|
||||||
void RemoveGameObject(uint32 spellid, bool del);
|
void RemoveGameObject(uint32 spellid, bool del);
|
||||||
void RemoveAllGameObjects();
|
void RemoveAllGameObjects();
|
||||||
DynamicObject *GetDynObject(uint32 spellId, uint32 effIndex);
|
|
||||||
DynamicObject *GetDynObject(uint32 spellId);
|
|
||||||
uint32 CalculateDamage(WeaponAttackType attType, bool normalized);
|
uint32 CalculateDamage(WeaponAttackType attType, bool normalized);
|
||||||
float GetAPMultiplier(WeaponAttackType attType, bool normalized);
|
float GetAPMultiplier(WeaponAttackType attType, bool normalized);
|
||||||
void ModifyAuraState(AuraState flag, bool apply);
|
void ModifyAuraState(AuraState flag, bool apply);
|
||||||
|
|
@ -1455,7 +1459,8 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
||||||
typedef std::list<uint64> DynObjectGUIDs;
|
typedef std::list<uint64> DynObjectGUIDs;
|
||||||
DynObjectGUIDs m_dynObjGUIDs;
|
DynObjectGUIDs m_dynObjGUIDs;
|
||||||
|
|
||||||
std::list<GameObject*> m_gameObj;
|
typedef std::list<GameObject*> GameObjectList;
|
||||||
|
GameObjectList m_gameObj;
|
||||||
bool m_isSorted;
|
bool m_isSorted;
|
||||||
uint32 m_transform;
|
uint32 m_transform;
|
||||||
uint32 m_removedAuras;
|
uint32 m_removedAuras;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "7656"
|
#define REVISION_NR "7657"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue