mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-05 16:39:08 +01:00
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:
@@ -643,17 +643,10 @@ void Item::SetState(ItemUpdateState state, Player *forplayer)
|
||||
|
||||
void Item::AddToUpdateQueueOf(Player *player)
|
||||
{
|
||||
if (IsInUpdateQueue()) return;
|
||||
if (IsInUpdateQueue())
|
||||
return;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
ASSERT(player != NULL);
|
||||
|
||||
if (player->GetGUID() != GetOwnerGUID())
|
||||
{
|
||||
@@ -661,7 +654,8 @@ void Item::AddToUpdateQueueOf(Player *player)
|
||||
return;
|
||||
}
|
||||
|
||||
if (player->m_itemUpdateQueueBlocked) return;
|
||||
if (player->m_itemUpdateQueueBlocked)
|
||||
return;
|
||||
|
||||
player->m_itemUpdateQueue.push_back(this);
|
||||
uQueuePos = player->m_itemUpdateQueue.size()-1;
|
||||
@@ -669,17 +663,10 @@ void Item::AddToUpdateQueueOf(Player *player)
|
||||
|
||||
void Item::RemoveFromUpdateQueueOf(Player *player)
|
||||
{
|
||||
if (!IsInUpdateQueue()) return;
|
||||
if (!IsInUpdateQueue())
|
||||
return;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
ASSERT(player != NULL)
|
||||
|
||||
if (player->GetGUID() != GetOwnerGUID())
|
||||
{
|
||||
@@ -687,7 +674,8 @@ void Item::RemoveFromUpdateQueueOf(Player *player)
|
||||
return;
|
||||
}
|
||||
|
||||
if (player->m_itemUpdateQueueBlocked) return;
|
||||
if (player->m_itemUpdateQueueBlocked)
|
||||
return;
|
||||
|
||||
player->m_itemUpdateQueue[uQueuePos] = NULL;
|
||||
uQueuePos = -1;
|
||||
|
||||
Reference in New Issue
Block a user