mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
Compare commits
8 Commits
b9345774f9
...
6056978687
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6056978687 | ||
|
|
7a1fa7b081 | ||
|
|
7aaefb76d9 | ||
|
|
896e1d3f38 | ||
|
|
a3b2c7ad0e | ||
|
|
c91ce7f7c2 | ||
|
|
befa0158e2 | ||
|
|
58e3316c45 |
@@ -1277,10 +1277,15 @@ void Item::ClearSoulboundTradeable(Player* currentOwner)
|
||||
|
||||
bool Item::CheckSoulboundTradeExpire()
|
||||
{
|
||||
// called from owner's update - GetOwner() MUST be valid
|
||||
if (GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME) + 2 * HOUR < GetOwner()->GetTotalPlayedTime())
|
||||
// we have to check the owner for mod_playerbots since bots programically call methods like DestroyItem,
|
||||
// MoveItemToMail, DestroyItemCount which do not handle soulboundTradeable clearing.
|
||||
Player* owner = GetOwner();
|
||||
if (!owner)
|
||||
return true; // remove from tradeable list
|
||||
|
||||
if (GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME) + 2 * HOUR < owner->GetTotalPlayedTime())
|
||||
{
|
||||
ClearSoulboundTradeable(GetOwner());
|
||||
ClearSoulboundTradeable(owner);
|
||||
return true; // remove from tradeable list
|
||||
}
|
||||
|
||||
|
||||
@@ -15971,6 +15971,11 @@ void Unit::CleanupBeforeRemoveFromMap(bool finalCleanup)
|
||||
if (IsInWorld()) // not in world and not being removed atm
|
||||
RemoveFromWorld();
|
||||
|
||||
// Added for mod_playerbots crash fixes; cancel and remove pending events before aura/spellmod cleanup.
|
||||
// Without this SpellEvent may be cancelled later during EventProcessor destruction after auras/spellmods
|
||||
// are already removed and leading to invalid access in Player::RestoreSpellMods on logout.
|
||||
m_Events.KillAllEvents(false);
|
||||
|
||||
ASSERT(GetGUID());
|
||||
|
||||
// A unit may be in removelist and not in world, but it is still in grid
|
||||
|
||||
Reference in New Issue
Block a user