Core/Trade: Fixed crash in WorldSession::moveItems, thx Derex for pointing it out
Closes issue #4216. --HG-- branch : trunk
This commit is contained in:
@@ -159,10 +159,11 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
|
|||||||
trader->GetName(), trader->GetSession()->GetAccountId());
|
trader->GetName(), trader->GetSession()->GetAccountId());
|
||||||
}
|
}
|
||||||
|
|
||||||
// store
|
// adjust time (depends on /played)
|
||||||
trader->MoveItemToInventory(traderDst, myItems[i], true, true);
|
|
||||||
if (myItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE))
|
if (myItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE))
|
||||||
myItems[i]->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, trader->GetTotalPlayedTime()-(_player->GetTotalPlayedTime()-myItems[i]->GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME)));
|
myItems[i]->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, trader->GetTotalPlayedTime()-(_player->GetTotalPlayedTime()-myItems[i]->GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME)));
|
||||||
|
// store
|
||||||
|
trader->MoveItemToInventory(traderDst, myItems[i], true, true);
|
||||||
}
|
}
|
||||||
if (hisItems[i])
|
if (hisItems[i])
|
||||||
{
|
{
|
||||||
@@ -176,10 +177,11 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
|
|||||||
_player->GetName(), _player->GetSession()->GetAccountId());
|
_player->GetName(), _player->GetSession()->GetAccountId());
|
||||||
}
|
}
|
||||||
|
|
||||||
// store
|
// adjust time (depends on /played)
|
||||||
_player->MoveItemToInventory(playerDst, hisItems[i], true, true);
|
|
||||||
if (hisItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE))
|
if (hisItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE))
|
||||||
hisItems[i]->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, _player->GetTotalPlayedTime()-(trader->GetTotalPlayedTime()-hisItems[i]->GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME)));
|
hisItems[i]->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, _player->GetTotalPlayedTime()-(trader->GetTotalPlayedTime()-hisItems[i]->GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME)));
|
||||||
|
// store
|
||||||
|
_player->MoveItemToInventory(playerDst, hisItems[i], true, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user