Fix issue with .save or .saveall where either the core would freeze, or items would not be saved to the DB properly.
Fixes issue #381 Fixes issue #477 --HG-- branch : trunk
This commit is contained in:
+10
-22
@@ -643,17 +643,10 @@ void Item::SetState(ItemUpdateState state, Player *forplayer)
|
|||||||
|
|
||||||
void Item::AddToUpdateQueueOf(Player *player)
|
void Item::AddToUpdateQueueOf(Player *player)
|
||||||
{
|
{
|
||||||
if (IsInUpdateQueue()) return;
|
if (IsInUpdateQueue())
|
||||||
|
|
||||||
if (!player)
|
|
||||||
{
|
|
||||||
player = GetOwner();
|
|
||||||
if (!player)
|
|
||||||
{
|
|
||||||
sLog.outDebug("Item::AddToUpdateQueueOf - GetPlayer didn't find a player matching owner's guid (%u)!", GUID_LOPART(GetOwnerGUID()));
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
ASSERT(player != NULL);
|
||||||
|
|
||||||
if (player->GetGUID() != GetOwnerGUID())
|
if (player->GetGUID() != GetOwnerGUID())
|
||||||
{
|
{
|
||||||
@@ -661,7 +654,8 @@ void Item::AddToUpdateQueueOf(Player *player)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->m_itemUpdateQueueBlocked) return;
|
if (player->m_itemUpdateQueueBlocked)
|
||||||
|
return;
|
||||||
|
|
||||||
player->m_itemUpdateQueue.push_back(this);
|
player->m_itemUpdateQueue.push_back(this);
|
||||||
uQueuePos = player->m_itemUpdateQueue.size()-1;
|
uQueuePos = player->m_itemUpdateQueue.size()-1;
|
||||||
@@ -669,17 +663,10 @@ void Item::AddToUpdateQueueOf(Player *player)
|
|||||||
|
|
||||||
void Item::RemoveFromUpdateQueueOf(Player *player)
|
void Item::RemoveFromUpdateQueueOf(Player *player)
|
||||||
{
|
{
|
||||||
if (!IsInUpdateQueue()) return;
|
if (!IsInUpdateQueue())
|
||||||
|
|
||||||
if (!player)
|
|
||||||
{
|
|
||||||
player = GetOwner();
|
|
||||||
if (!player)
|
|
||||||
{
|
|
||||||
sLog.outDebug("Item::RemoveFromUpdateQueueOf - GetPlayer didn't find a player matching owner's guid (%u)!", GUID_LOPART(GetOwnerGUID()));
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
ASSERT(player != NULL)
|
||||||
|
|
||||||
if (player->GetGUID() != GetOwnerGUID())
|
if (player->GetGUID() != GetOwnerGUID())
|
||||||
{
|
{
|
||||||
@@ -687,7 +674,8 @@ void Item::RemoveFromUpdateQueueOf(Player *player)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->m_itemUpdateQueueBlocked) return;
|
if (player->m_itemUpdateQueueBlocked)
|
||||||
|
return;
|
||||||
|
|
||||||
player->m_itemUpdateQueue[uQueuePos] = NULL;
|
player->m_itemUpdateQueue[uQueuePos] = NULL;
|
||||||
uQueuePos = -1;
|
uQueuePos = -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user