*Fix a bug that causes crash when player data is corrupted. By Rognar.
--HG-- branch : trunk
This commit is contained in:
+1
-1
@@ -473,7 +473,7 @@ Player::~Player ()
|
|||||||
for(BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr)
|
for(BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr)
|
||||||
itr->second.save->RemovePlayer(this);
|
itr->second.save->RemovePlayer(this);
|
||||||
|
|
||||||
if (isPossessing())
|
if (m_uint32Values && isPossessing())
|
||||||
RemovePossess(false);
|
RemovePossess(false);
|
||||||
|
|
||||||
delete m_declinedname;
|
delete m_declinedname;
|
||||||
|
|||||||
+7
-1
@@ -1084,7 +1084,13 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
|||||||
bool isCharmed() const { return GetCharmerGUID() != 0; }
|
bool isCharmed() const { return GetCharmerGUID() != 0; }
|
||||||
bool isPossessed() const { return m_isPossessed; }
|
bool isPossessed() const { return m_isPossessed; }
|
||||||
bool isPossessedByPlayer() const { return m_isPossessed && IS_PLAYER_GUID(GetCharmerGUID()); }
|
bool isPossessedByPlayer() const { return m_isPossessed && IS_PLAYER_GUID(GetCharmerGUID()); }
|
||||||
bool isPossessing() const { return GetCharm() && GetCharm()->isPossessed(); }
|
bool isPossessing() const
|
||||||
|
{
|
||||||
|
if(Unit *u = GetCharm())
|
||||||
|
return u->isPossessed();
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
bool isPossessing(Unit* u) const { return u->isPossessed() && GetCharmGUID() == u->GetGUID(); }
|
bool isPossessing(Unit* u) const { return u->isPossessed() && GetCharmGUID() == u->GetGUID(); }
|
||||||
bool isPossessingCreature() const { return isPossessing() && IS_CREATURE_GUID(GetCharmGUID()); }
|
bool isPossessingCreature() const { return isPossessing() && IS_CREATURE_GUID(GetCharmGUID()); }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user