Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
- index b2d88630aeb5..2e0e76119664 100644
- --- a/src/server/game/Entities/GameObject/GameObject.cpp
- +++ b/src/server/game/Entities/GameObject/GameObject.cpp
- @@ -755,7 +755,8 @@ void GameObject::Update(uint32 diff)
- m_usetimes = 0;
- }
- - SetGoState(GO_STATE_READY);
- + if (GetGOInfo()->GetLockId() || GetGOInfo()->GetAutoCloseTime())
- + SetGoState(GO_STATE_READY);
- //any return here in case battleground traps
- if (GameObjectOverride const* goOverride = GetGameObjectOverride())
- @@ -765,23 +766,19 @@ void GameObject::Update(uint32 diff)
- loot.clear();
- - //! If this is summoned by a spell with ie. SPELL_EFFECT_SUMMON_OBJECT_WILD, with or without owner, we check respawn criteria based on spell
- - //! The GetOwnerGUID() check is mostly for compatibility with hacky scripts - 99% of the time summoning should be done trough spells.
- - if (GetSpellId() || GetOwnerGUID())
- + //Don't delete chests and goobers that have the flag consumable=0
- + if (!GetGOInfo()->IsDespawnAtAction())
- {
- - //Don't delete spell spawned chests, which are not consumed on loot
- - if (m_respawnTime > 0 && GetGoType() == GAMEOBJECT_TYPE_CHEST && !GetGOInfo()->IsDespawnAtAction())
- - {
- - UpdateObjectVisibility();
- - SetLootState(GO_READY);
- - }
- - else
- - {
- - SetRespawnTime(0);
- - Delete();
- - }
- - return;
- + UpdateObjectVisibility();
- + SetLootState(GO_READY);
- }
- + else
- + {
- + SetRespawnTime(0);
- + Delete();
- + }
- + return;
- +
- SetLootState(GO_NOT_READY);
- @@ -1047,13 +1044,7 @@ bool GameObject::LoadFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap
- {
- m_spawnedByDefault = true;
- - if (!GetGOInfo()->GetDespawnPossibility() && !GetGOInfo()->IsDespawnAtAction())
- - {
- - SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NODESPAWN);
- - m_respawnDelayTime = 0;
- - m_respawnTime = 0;
- - }
- - else
- + if (GetGOInfo()->IsDespawnAtAction())
- {
- m_respawnDelayTime = data->spawntimesecs;
- m_respawnTime = GetMap()->GetGORespawnTime(m_spawnId);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement